<commit_before>#!/usr/bin/env ts-node

import test  from 'tstest'

import { UrlLink } from './url-link'

test('UrlLink', async t => {
  const urlLink = await UrlLink.create('https://wechaty.js.org/2020/07/02/wechat-bot-in-ten-minutes')
  t.true(urlLink.title, 'should have title',)
  t.true(urlLink.description, 'should have description',)
  t.true(urlLink.url, 'should have url',)
  t.true(urlLink.thumbnailUrl, 'should have thumbnailUrl',)
})<commit_msg>add strict check<commit_after>#!/usr/bin/env ts-node

import test  from 'tstest'

import { UrlLink } from './url-link'

test('UrlLink', async t => {
  const URL = 'https://wechaty.js.org/2020/07/02/wechat-bot-in-ten-minutes'
  const EXPECTED_PAYLOAD = {
    description: '十分钟实现一个智能问答微信聊天机器人',
    thumbnailUrl: 'https://wechaty.js.org/assets/developers/luweicn/avatar.png',
    title: '十分钟实现一个智能问答微信聊天机器人',
    url: 'https://wechaty.js.org/2020/07/02/wechat-bot-in-ten-minutes'
  }

  const urlLink = await UrlLink.create(URL)
  t.equal(urlLink.title(),        EXPECTED_PAYLOAD.title, 'should have title',)
  t.equal(urlLink.description(),  EXPECTED_PAYLOAD.description, 'should have description',)
  t.equal(urlLink.url(),          EXPECTED_PAYLOAD.url, 'should have url',)
  t.equal(urlLink.thumbnailUrl(), EXPECTED_PAYLOAD.thumbnailUrl, 'should have thumbnailUrl',)
})
{'fraction_non_alphanumeric': 0.16126601356443104, 'fraction_numerical': 0.01808590806330068, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5799874', 'n_tokens_mistral': 533, 'n_tokens_neox': 528, 'n_words': 85}