Skip to content

Commit 7494315

Browse files
authored
test: switch to vitest (#289)
1 parent 71f8e5c commit 7494315

7 files changed

+502
-2352
lines changed

jest.config.js

-13
This file was deleted.

package.json

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"prettier:check": "prettier --list-different \"{src,test}/**/*.ts\"",
1818
"prettier:write": "prettier --write \"{src,test}/**/*.ts\"",
1919
"pretest": "tsc",
20-
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest"
20+
"test": "vitest run"
2121
},
2222
"author": {
2323
"name": "Samuel Attard",
@@ -30,15 +30,12 @@
3030
"devDependencies": {
3131
"@electron/docs-parser": "^2.0.0",
3232
"@types/debug": "^4.1.12",
33-
"@types/jest": "^29.5.13",
3433
"@types/lodash": "^4.17.7",
35-
"cross-env": "^7.0.3",
3634
"husky": "^9.1.6",
37-
"jest": "^30.0.0-alpha.6",
3835
"lint-staged": "^15.2.10",
3936
"prettier": "^3.3.3",
40-
"ts-jest": "^29.2.5",
41-
"typescript": "^5.6.2"
37+
"typescript": "^5.6.2",
38+
"vitest": "^3.0.4"
4239
},
4340
"dependencies": {
4441
"@types/node": "^20.11.25",

test/output.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import fs from 'node:fs';
22
import { spawnSync } from 'node:child_process';
33
import path from 'node:path';
44

5+
import { beforeAll, describe, expect, it } from 'vitest';
6+
57
const OUTPUT_PATH = path.resolve(import.meta.dirname, '..', 'electron.d.ts');
68
let output: string;
79

test/remap-optionals.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import _ from 'lodash';
2+
import { describe, expect, it } from 'vitest';
23

34
import { remapOptionals } from '../src/remap-optionals.js';
45

test/utils.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { DocumentationTag } from '@electron/docs-parser';
2+
import { describe, expect, it } from 'vitest';
23

34
import * as utils from '../src/utils.js';
45

tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"es7"
1010
],
1111
"types": [
12-
"node",
13-
"jest"
12+
"node"
1413
],
1514
"declaration": false,
1615
"sourceMap": true,

yarn.lock

+494-2,331
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)