Skip to content

Commit f1e86e3

Browse files
authored
fix: Replace Tap with node.js test runner (#456)
1 parent 5a3bf88 commit f1e86e3

25 files changed

Lines changed: 1339 additions & 5063 deletions

package-lock.json

Lines changed: 285 additions & 4064 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,13 @@
1212
"types",
1313
"eikjson.d.ts"
1414
],
15-
"tap": {
16-
"exclude": [
17-
"test/**/*.d.ts",
18-
"test/fixtures/**"
19-
]
20-
},
2115
"scripts": {
22-
"clean": "rimraf .tap node_modules types",
16+
"clean": "node -e \"['.tap', 'node_modules', 'types'].forEach(d => require('fs').rmSync(d, {recursive: true, force: true}))\"",
2317
"lint": "eslint .",
2418
"lint:fix": "eslint --fix .",
2519
"schema:types": "json2ts lib/schemas/eikjson.schema.json > eikjson.d.ts",
2620
"schema:outdated": "npm run schema:types && git diff --exit-code HEAD:eikjson.d.ts eikjson.d.ts",
27-
"test": "tap --disable-coverage --allow-empty-coverage",
21+
"test": "node --test 'test/**/*.test.js'",
2822
"types": "run-s types:module types:test",
2923
"types:module": "tsc",
3024
"types:test": "tsc --project tsconfig.test.json"
@@ -54,6 +48,7 @@
5448
"@eik/semantic-release-config": "1.0.17",
5549
"@eik/typescript-config": "1.0.2",
5650
"@eik/eslint-config": "2.0.6",
51+
"@types/node": "25.0.1",
5752
"@semantic-release/changelog": "6.0.3",
5853
"@semantic-release/git": "10.0.1",
5954
"@types/is-glob": "4.0.4",
@@ -65,10 +60,8 @@
6560
"json-schema-to-typescript": "15.0.4",
6661
"npm-run-all2": "9.0.1",
6762
"prettier": "3.8.3",
68-
"rimraf": "6.1.3",
6963
"semantic-release": "25.0.3",
7064
"stoppable": "1.1.0",
71-
"tap": "21.7.4",
7265
"typescript": "6.0.3"
7366
}
7467
}
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { test } from "tap";
1+
import { test } from "node:test";
2+
import assert from "node:assert/strict";
23
import EikConfig from "../../../lib/classes/eik-config.js";
34

45
const validEikConfig = {
@@ -8,27 +9,29 @@ const validEikConfig = {
89
version: "0.0.0",
910
};
1011

11-
test("EikConfig: .cwd set to /some/path", (t) => {
12+
test("EikConfig: .cwd set to /some/path", () => {
1213
const config = new EikConfig(validEikConfig, [], "/some/path");
13-
t.equal(config.cwd, "/some/path", "should equal the given cwd");
14-
t.end();
14+
assert.strictEqual(config.cwd, "/some/path", "should equal the given cwd");
1515
});
1616

17-
test("EikConfig: .cwd set to /some/path/", (t) => {
17+
test("EikConfig: .cwd set to /some/path/", () => {
1818
const config = new EikConfig(validEikConfig, [], "/some/path/");
19-
t.equal(config.cwd, "/some/path", "should normalize the given cwd");
20-
t.end();
19+
assert.strictEqual(
20+
config.cwd,
21+
"/some/path",
22+
"should normalize the given cwd",
23+
);
2124
});
2225

23-
test("EikConfig: .cwd set to invalid relative path some/path", (t) => {
26+
test("EikConfig: .cwd set to invalid relative path some/path", () => {
2427
try {
2528
new EikConfig(validEikConfig, [], "some/path");
2629
} catch (err) {
27-
t.match(
28-
err instanceof Error ? err.message : String(err),
29-
'"configRootDir" must be an absolute path:',
30+
assert.ok(
31+
(err instanceof Error ? err.message : String(err)).includes(
32+
'"configRootDir" must be an absolute path:',
33+
),
3034
"should throw expected error with message",
3135
);
3236
}
33-
t.end();
3437
});
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { test } from "tap";
1+
import { test } from "node:test";
2+
import assert from "node:assert/strict";
23
import EikConfig from "../../../lib/classes/eik-config.js";
34

45
const validEikConfig = {
@@ -8,24 +9,26 @@ const validEikConfig = {
89
version: "0.0.0",
910
};
1011

11-
test("EikConfig: .map: set to string http://map", (t) => {
12+
test("EikConfig: .map: set to string http://map", () => {
1213
const config = new EikConfig({
1314
...validEikConfig,
1415
"import-map": "http://map",
1516
});
16-
t.same(config.map, ["http://map"], "should be wrapped into an array");
17-
t.end();
17+
assert.deepStrictEqual(
18+
config.map,
19+
["http://map"],
20+
"should be wrapped into an array",
21+
);
1822
});
1923

20-
test("EikConfig: .map: set to an array with two values", (t) => {
24+
test("EikConfig: .map: set to an array with two values", () => {
2125
const config = new EikConfig({
2226
...validEikConfig,
2327
"import-map": ["http://map", "http://map"],
2428
});
25-
t.same(
29+
assert.deepStrictEqual(
2630
config.map,
2731
["http://map", "http://map"],
2832
"should remain the same as input",
2933
);
30-
t.end();
3134
});

0 commit comments

Comments
 (0)