@scrabble-solver/word-definitions 2.15.25 → 2.16.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/word-definitions",
3
- "version": "2.15.25",
3
+ "version": "2.16.0-alpha.0",
4
4
  "description": "Scrabble Solver 2 - Word definitions",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -20,10 +20,11 @@
20
20
  "homepage": "https://scrabble-solver.org",
21
21
  "scripts": {
22
22
  "build": "tsgo --project .",
23
- "clean": "rimraf build/"
23
+ "clean": "rimraf build/",
24
+ "test": "bun test --timeout 180000 src"
24
25
  },
25
26
  "dependencies": {
26
- "@scrabble-solver/types": "^2.15.25",
27
+ "@scrabble-solver/types": "^2.16.0-alpha.0",
27
28
  "cheerio": "^1.2.0",
28
29
  "follow-redirects": "^1.16.0",
29
30
  "striptags": "^3.2.0"
@@ -32,5 +33,5 @@
32
33
  "@types/follow-redirects": "^1.14.4",
33
34
  "domhandler": "^6.0.1"
34
35
  },
35
- "gitHead": "804532994a83eec4bd83e573744093865b5d1fa7"
36
+ "gitHead": "c9d35d0e7f7c187fbd2b0eaf04d621595e520bd9"
36
37
  }
package/src/parse.test.ts CHANGED
@@ -3,12 +3,17 @@ import fs from 'fs';
3
3
  import path from 'path';
4
4
 
5
5
  import { parse } from './parse';
6
+ import { type ParsingResult } from './types';
6
7
 
7
8
  const readTestFile = (filepath: string): string => {
8
9
  const absoluteFilepath = path.resolve(__dirname, '__tests__', filepath);
9
10
  return fs.readFileSync(absoluteFilepath, 'utf-8');
10
11
  };
11
12
 
13
+ const readExpected = (filepath: string): ParsingResult => {
14
+ return JSON.parse(readTestFile(filepath));
15
+ };
16
+
12
17
  const tests = [
13
18
  { locale: Locale.DE_DE, word: 'hm' },
14
19
  { locale: Locale.DE_DE, word: 'ho' },
@@ -29,7 +34,7 @@ const tests = [
29
34
  describe('parse', () => {
30
35
  it.each(tests)(`[$locale] "$word"`, ({ locale, word }) => {
31
36
  const input = readTestFile(`input/${locale}.${word}.html`);
32
- const expected = readTestFile(`expected/${locale}.${word}.json`);
33
- expect(parse(locale, input)).toEqual(JSON.parse(expected));
37
+ const expected = readExpected(`expected/${locale}.${word}.json`);
38
+ expect(parse(locale, input)).toEqual(expected);
34
39
  });
35
40
  });