Skip to content

Commit 30933ef

Browse files
committed
test: run local-nodes packages on Vitest
1 parent a551dfc commit 30933ef

39 files changed

Lines changed: 319 additions & 414 deletions

‎oxlint-suppressions.json‎

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,11 +1409,6 @@
14091409
"count": 4
14101410
}
14111411
},
1412-
"packages/bitcoin-regtest-up/jest.config.cjs": {
1413-
"import/unambiguous": {
1414-
"count": 1
1415-
}
1416-
},
14171412
"packages/bitcoin-regtest-up/src/bin/bitcoin-regtest-up.ts": {
14181413
"typescript/no-unsafe-argument": {
14191414
"count": 2
@@ -1440,6 +1435,9 @@
14401435
},
14411436
"typescript/no-unsafe-return": {
14421437
"count": 2
1438+
},
1439+
"vitest/no-conditional-in-test": {
1440+
"count": 2
14431441
}
14441442
},
14451443
"packages/bitcoin-regtest-up/src/install.ts": {
@@ -2005,11 +2003,6 @@
20052003
"count": 2
20062004
}
20072005
},
2008-
"packages/config-registry-controller/jest.config.cjs": {
2009-
"import/unambiguous": {
2010-
"count": 1
2011-
}
2012-
},
20132006
"packages/connectivity-controller/jest.config.cjs": {
20142007
"import/unambiguous": {
20152008
"count": 1
@@ -2576,11 +2569,6 @@
25762569
"count": 1
25772570
}
25782571
},
2579-
"packages/java-tron-up/jest.config.cjs": {
2580-
"import/unambiguous": {
2581-
"count": 1
2582-
}
2583-
},
25842572
"packages/java-tron-up/src/bin/java-tron-up.ts": {
25852573
"typescript/no-unsafe-argument": {
25862574
"count": 2
@@ -2607,6 +2595,9 @@
26072595
},
26082596
"typescript/no-unsafe-return": {
26092597
"count": 2
2598+
},
2599+
"vitest/no-conditional-in-test": {
2600+
"count": 4
26102601
}
26112602
},
26122603
"packages/java-tron-up/src/install.ts": {
@@ -2814,11 +2805,6 @@
28142805
"count": 1
28152806
}
28162807
},
2817-
"packages/local-node-utils/jest.config.cjs": {
2818-
"import/unambiguous": {
2819-
"count": 1
2820-
}
2821-
},
28222808
"packages/local-node-utils/src/artifact.ts": {
28232809
"typescript/no-unsafe-call": {
28242810
"count": 3
@@ -5005,11 +4991,6 @@
50054991
"count": 54
50064992
}
50074993
},
5008-
"packages/solana-test-validator-up/jest.config.cjs": {
5009-
"import/unambiguous": {
5010-
"count": 1
5011-
}
5012-
},
50134994
"packages/solana-test-validator-up/src/bin/solana-test-validator-up.ts": {
50144995
"no-undef": {
50154996
"count": 3
@@ -5039,6 +5020,9 @@
50395020
},
50405021
"typescript/no-unsafe-return": {
50415022
"count": 2
5023+
},
5024+
"vitest/no-conditional-in-test": {
5025+
"count": 1
50425026
}
50435027
},
50445028
"packages/solana-test-validator-up/src/install.ts": {
@@ -5058,11 +5042,6 @@
50585042
"count": 5
50595043
}
50605044
},
5061-
"packages/stellar-quickstart-up/jest.config.cjs": {
5062-
"import/unambiguous": {
5063-
"count": 1
5064-
}
5065-
},
50665045
"packages/storage-service/jest.config.cjs": {
50675046
"import/unambiguous": {
50685047
"count": 1

‎packages/bitcoin-regtest-up/jest.config.cjs‎

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

‎packages/bitcoin-regtest-up/package.json‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,22 @@
4545
"messenger-action-types:check": "node --import ../../scripts/resolver/register.ts --experimental-transform-types ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --check",
4646
"messenger-action-types:generate": "node --import ../../scripts/resolver/register.ts --experimental-transform-types ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --generate",
4747
"since-latest-release": "../../scripts/since-latest-release.sh",
48-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
49-
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
50-
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
51-
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
48+
"test": "vitest",
49+
"test:clean": "vitest --clearCache",
50+
"test:verbose": "vitest --reporter=verbose",
51+
"test:watch": "vitest --watch"
5252
},
5353
"dependencies": {
5454
"@metamask/local-node-utils": "^2.0.0"
5555
},
5656
"devDependencies": {
5757
"@metamask/auto-changelog": "^6.2.1",
58-
"@types/jest": "^30.0.0",
5958
"@typescript/native": "npm:typescript@^7.0.2",
60-
"deepmerge": "^4.3.1",
61-
"jest": "^30.5.2",
6259
"rimraf": "^6.1.3",
63-
"ts-jest": "^29.4.14",
6460
"typedoc": "^0.28.20",
6561
"typedoc-plugin-missing-exports": "^4.1.4",
66-
"typescript": "npm:@typescript/typescript6@^6.0.2"
62+
"typescript": "npm:@typescript/typescript6@^6.0.2",
63+
"vitest": "^5.0.0"
6764
},
6865
"engines": {
6966
"node": "^22.14.0 || ^24"

‎packages/bitcoin-regtest-up/src/install.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable jest/expect-expect, n/no-sync */
1+
/* eslint-disable vitest/expect-expect, n/no-sync */
22
import assert from 'node:assert/strict';
33
import { execFileSync } from 'node:child_process';
44
import { createHash } from 'node:crypto';
@@ -15,6 +15,7 @@ import {
1515
import { mkdir, writeFile } from 'node:fs/promises';
1616
import { tmpdir } from 'node:os';
1717
import { join } from 'node:path';
18+
import { afterEach, describe, it } from 'vitest';
1819

1920
import {
2021
BITCOIN_REGTEST_DEFAULT_CORE,

‎packages/bitcoin-regtest-up/tsconfig.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"extends": "../../tsconfig.packages.json",
3-
"compilerOptions": {
4-
"types": ["jest"]
5-
},
63
"references": [
74
{
85
"path": "../local-node-utils"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { basename, dirname } from 'node:path';
2+
import { fileURLToPath } from 'node:url';
3+
import { defineConfig, mergeConfig } from 'vitest/config';
4+
5+
import baseConfig from '../../vitest.config.packages.js';
6+
7+
export default mergeConfig(
8+
baseConfig,
9+
defineConfig({
10+
test: {
11+
name: basename(dirname(fileURLToPath(import.meta.url))),
12+
13+
coverage: {
14+
// The CLI entrypoint is exercised through package builds and installed-bin smoke tests.
15+
exclude: ['src/bin/bitcoin-regtest-up.ts'],
16+
17+
thresholds: {
18+
branches: 62.5,
19+
functions: 100,
20+
lines: 92.63,
21+
statements: 92.7,
22+
},
23+
},
24+
},
25+
}),
26+
);

‎packages/config-registry-controller/jest.config.cjs‎

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

‎packages/config-registry-controller/package.json‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"messenger-action-types:generate": "node --import ../../scripts/resolver/register.ts --experimental-transform-types ../../packages/messenger-cli/src/cli.ts --formatter oxfmt --esm --generate",
4646
"publish:preview": "yarn npm publish --tag preview",
4747
"since-latest-release": "../../scripts/since-latest-release.sh",
48-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
49-
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
50-
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
51-
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
48+
"test": "vitest",
49+
"test:clean": "vitest --clearCache",
50+
"test:verbose": "vitest --reporter=verbose",
51+
"test:watch": "vitest --watch"
5252
},
5353
"dependencies": {
5454
"@metamask/base-controller": "^10.1.0",
@@ -64,16 +64,13 @@
6464
"devDependencies": {
6565
"@lavamoat/allow-scripts": "^5.1.0",
6666
"@metamask/auto-changelog": "^6.2.1",
67-
"@types/jest": "^30.0.0",
6867
"@typescript/native": "npm:typescript@^7.0.2",
69-
"deepmerge": "^4.3.1",
70-
"jest": "^30.5.2",
7168
"nock": "^13.5.6",
7269
"rimraf": "^6.1.3",
73-
"ts-jest": "^29.4.14",
7470
"typedoc": "^0.28.20",
7571
"typedoc-plugin-missing-exports": "^4.1.4",
76-
"typescript": "npm:@typescript/typescript6@^6.0.2"
72+
"typescript": "npm:@typescript/typescript6@^6.0.2",
73+
"vitest": "^5.0.0"
7774
},
7875
"engines": {
7976
"node": "^22.14.0 || ^24"

0 commit comments

Comments
 (0)