<commit_before>/* global expect test */
const { Lyric } = require('./musixmatch');
const BlockedError = require('../include/blocked_error');

async function testLyric(obj) {
  const { url } = obj;
  const inst = new Lyric(url);
  try {
    await inst.get();
  } catch (e) {
    if (e instanceof BlockedError) {
      console.warn('Blocked by vendor');
      return;
    }
  }

  expect(inst.title).toBe(obj.title);
  expect(inst.artist).toBe(obj.artist);
  if (obj.lyricist) expect(inst.lyricist).toBe(obj.lyricist);
  if (obj.composer) expect(inst.composer).toBe(obj.composer);
  if (obj.length) expect(inst.lyric.length).toBe(obj.length);
}

test('', async () => {
  await testLyric({
    url:
      'https://www.musixmatch.com/lyrics/SawanoHiroyuki-nZk-Tielle-Gemie/sh0ut',
    title: 'sh0ut',
    artist: 'SawanoHiroyuki[nZk]:Tielle&Gemie',
    length: 1719,
  });
});

test('', async () => {
  await testLyric({
    url:
      'https://www.musixmatch.com/lyrics/Mariah-Carey-feat-Ne%E2%80%90Yo/Angels-Cry',
    title: 'Angels Cry',
    artist: 'Mariah Carey feat. Ne-Yo',
    length: 1808,
  });
});<commit_msg>change musixmatch test url<commit_after>/* global expect test */
const { Lyric } = require('./musixmatch');
const BlockedError = require('../include/blocked_error');

async function testLyric(obj) {
  const { url } = obj;
  const inst = new Lyric(url);
  try {
    await inst.get();
  } catch (e) {
    if (e instanceof BlockedError) {
      console.warn('Blocked by vendor');
      return;
    }
  }

  expect(inst.title).toBe(obj.title);
  expect(inst.artist).toBe(obj.artist);
  if (obj.lyricist) expect(inst.lyricist).toBe(obj.lyricist);
  if (obj.composer) expect(inst.composer).toBe(obj.composer);
  if (obj.length) expect(inst.lyric.length).toBe(obj.length);
}

test('', async () => {
  await testLyric({
    url:
      'https://www.musixmatch.com/lyrics/SawanoHiroyuki-nZk-Tielle-Gemie/sh0ut',
    title: 'sh0ut',
    artist: 'SawanoHiroyuki[nZk]:Tielle&Gemie',
    length: 1719,
  });
});

test('', async () => {
  await testLyric({
    url: 'https://www.musixmatch.com/lyrics/L-Arc-en-Ciel/Honey',
    title: "Honey",
    artist: "L'Arc-en-Ciel",
    length: 433,
  });
});
{'fraction_non_alphanumeric': 0.18417462482946795, 'fraction_numerical': 0.010914051841746248, 'mean_word_length': 3.462474645030426, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '3508784', 'n_tokens_mistral': 868, 'n_tokens_neox': 843, 'n_words': 143}