Skip to content

Commit 1a77f22

Browse files
committed
chore(deps-dev): remove jest in favor of Node test runner
1 parent 40ae4c0 commit 1a77f22

5 files changed

Lines changed: 15 additions & 45 deletions

File tree

.eslintrc.cjs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ module.exports = {
33
browser: false,
44
commonjs: true,
55
es2020: true,
6-
"jest/globals": true,
76
},
87
extends: ["eslint:recommended", "plugin:n/recommended"],
9-
plugins: ["jest", "unicorn"],
8+
plugins: ["unicorn"],
109
globals: {
1110
Atomics: "readonly",
1211
SharedArrayBuffer: "readonly",
@@ -34,12 +33,6 @@ module.exports = {
3433
{ ignoreRestSiblings: true },
3534
],
3635
"n/no-deprecated-api": "off",
37-
"n/no-extraneous-import": [
38-
"error",
39-
{
40-
allowModules: ["@jest/globals"],
41-
},
42-
],
4336
"n/no-missing-import": "off",
4437
"n/no-unpublished-import": "off",
4538
"n/hashbang": "off",

jest.config.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

libs/constants/index.test.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { describe, it } from "node:test";
2+
import assert from "node:assert/strict";
13
import {
24
createRegExpFromExtensions,
35
ANY_ATTACHMENT_REGEXP,
@@ -8,55 +10,55 @@ describe("createRegExpFromExt", () => {
810
const regexp = createRegExpFromExtensions("foo");
911

1012
it("accepts the extension", () => {
11-
expect(regexp.test("test.foo")).toEqual(true);
13+
assert.strictEqual(regexp.test("test.foo"), true);
1214
});
1315

1416
it("accepts uppercase", () => {
15-
expect(regexp.test("test.FOO")).toEqual(true);
17+
assert.strictEqual(regexp.test("test.FOO"), true);
1618
});
1719

1820
it("rejects intermediate extensions", () => {
19-
expect(regexp.test("test.foo.bar")).toEqual(false);
21+
assert.strictEqual(regexp.test("test.foo.bar"), false);
2022
});
2123

2224
it("rejects other extensions", () => {
23-
expect(regexp.test("test.bar")).toEqual(false);
25+
assert.strictEqual(regexp.test("test.bar"), false);
2426
});
2527

2628
it("rejects extensions starting with it", () => {
27-
expect(regexp.test("test.foob")).toEqual(false);
29+
assert.strictEqual(regexp.test("test.foob"), false);
2830
});
2931

3032
it("rejects extensions ending with it", () => {
31-
expect(regexp.test("test.afoo")).toEqual(false);
33+
assert.strictEqual(regexp.test("test.afoo"), false);
3234
});
3335
});
3436

3537
describe("ANY_ATTACHMENT_REGEXP", () => {
3638
const regexp = ANY_ATTACHMENT_REGEXP;
3739
it("accepts audio files", () => {
38-
expect(regexp.test("audio.mp3")).toEqual(true);
40+
assert.strictEqual(regexp.test("audio.mp3"), true);
3941
});
4042

4143
it("accepts video files", () => {
42-
expect(regexp.test("video.mp4")).toEqual(true);
44+
assert.strictEqual(regexp.test("video.mp4"), true);
4345
});
4446

4547
it("accepts font files", () => {
46-
expect(regexp.test("diagram.svg")).toEqual(true);
48+
assert.strictEqual(regexp.test("diagram.svg"), true);
4749
});
4850

4951
["index.html", "index.json", "index.md", "contributors.txt"].forEach(
5052
(filename) =>
5153
it(`rejects ${filename}`, () => {
52-
expect(regexp.test(filename)).toEqual(false);
54+
assert.strictEqual(regexp.test(filename), false);
5355
})
5456
);
5557
});
5658

5759
describe("BINARY_ATTACHMENT_REGEXP", () => {
5860
const regexp = BINARY_ATTACHMENT_REGEXP;
5961
it("rejects svg files", () => {
60-
expect(regexp.test("diagram.svg")).toEqual(false);
62+
assert.strictEqual(regexp.test("diagram.svg"), false);
6163
});
6264
});

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
"check:tsc": "find . -name 'tsconfig.json' ! -wholename '**/node_modules/**' ! -wholename '**/cloud-function/src/internal/**' -print0 | xargs -n1 -P 2 -0 sh -c 'cd `dirname $0` && echo \"🔄 $(pwd)\" && npx tsc --noEmit && echo \"☑️ $(pwd)\" || exit 255'",
1111
"eslint": "eslint .",
1212
"install:all": "find . -mindepth 2 -name 'package-lock.json' ! -wholename '**/node_modules/**' -print0 | xargs -n1 -0 sh -cx 'npm --prefix $(dirname $0) install'",
13-
"jest": "node --experimental-vm-modules --expose-gc ./node_modules/.bin/jest --logHeapUsage",
1413
"prepare": "npm run install:all",
1514
"prettier-check": "prettier --check .",
1615
"prettier-format": "prettier --write .",
1716
"test": "npm run prettier-check && npm run test:libs",
18-
"test:libs": "npm run jest --rootDir libs --env=node",
17+
"test:libs": "tsx --test libs/**/*.test.ts",
1918
"tool:legacy": "tsx ./tool/cli.ts"
2019
},
2120
"resolutions": {
@@ -49,20 +48,15 @@
4948
"@babel/preset-env": "^7.28.3",
5049
"@types/express": "^4.17.21",
5150
"@types/he": "^1.2.3",
52-
"@types/jest": "^29.5.14",
5351
"@types/node": "^22.16.0",
5452
"cross-env": "^7.0.3",
5553
"eslint": "^8.57.1",
5654
"eslint-plugin-import": "^2.32.0",
57-
"eslint-plugin-jest": "^29.0.1",
5855
"eslint-plugin-n": "^17.21.0",
5956
"eslint-plugin-unicorn": "^56.0.1",
60-
"jest": "^29.7.0",
61-
"jest-resolve": "^30.1.3",
6257
"lefthook": "^1.12.4",
6358
"prettier": "^3.6.2",
6459
"prettier-plugin-packagejson": "^2.5.19",
65-
"ts-jest": "^29.2.6",
6660
"typescript": "^5.9.2",
6761
"typescript-eslint": "^8.41.0"
6862
},

tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,5 @@
1919
"strict": true,
2020
"strictNullChecks": false,
2121
"target": "ES2020"
22-
},
23-
"ts-node": {
24-
"esm": true,
25-
"swc": true
2622
}
2723
}

0 commit comments

Comments
 (0)