Skip to content

Commit 5f52bc2

Browse files
committed
test(napi/parser): tweak vitest config
1 parent 544a090 commit 5f52bc2

File tree

3 files changed

+32
-70
lines changed

3 files changed

+32
-70
lines changed

napi/parser/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build": "pnpm run build-dev --release",
99
"build-wasi": "pnpm run build-dev --release --target wasm32-wasip1-threads",
1010
"build-npm-dir": "rm -rf npm-dir && napi create-npm-dirs --npm-dir npm-dir && pnpm napi artifacts --npm-dir npm-dir --output-dir .",
11-
"test": "vitest --typecheck run ./test/ && tsc",
11+
"test": "pnpm run test-node && tsc",
12+
"test-node": "vitest --dir test",
1213
"test-browser": "vitest -c vitest.config.browser.mts",
1314
"bench": "vitest bench --run ./bench.bench.mjs"
1415
},
@@ -52,7 +53,7 @@
5253
"devDependencies": {
5354
"@codspeed/vitest-plugin": "^4.0.0",
5455
"@napi-rs/wasm-runtime": "^0.2.7",
55-
"@vitest/browser": "3.0.7",
56+
"@vitest/browser": "3.0.8",
5657
"playwright": "^1.51.0",
5758
"vitest": "catalog:"
5859
},

napi/parser/vitest.config.mts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
// Enable Codspeed plugin in CI only
2-
const config = {};
3-
if (process.env.CI) {
4-
const codspeedPlugin = (await import('@codspeed/vitest-plugin')).default;
5-
// @ts-ignore
6-
config.plugins = [codspeedPlugin()];
7-
}
1+
import { defineConfig } from 'vitest/config';
82

9-
export default config;
3+
export default defineConfig({
4+
test: {
5+
diff: {
6+
expand: false,
7+
},
8+
},
9+
plugins: [
10+
// Enable Codspeed plugin in CI only
11+
process.env.CI && (await import('@codspeed/vitest-plugin')).default(),
12+
],
13+
});

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)