Skip to content

Commit 7459be4

Browse files
test(vitest): fix tests and update npm scripts
1 parent b0c76ca commit 7459be4

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@
4545
"prepare": "husky",
4646
"prepublishOnly": "run-s build lint lint:tsc lint:package",
4747
"size-limit": "size-limit",
48-
"test": "vitest run",
49-
"test:browser": "vitest run --config vitest.browser.config.mts --browser=chromium",
50-
"test:ci": "CI=true vitest run --color",
51-
"test:esm": "npm run build:esm && node --test test/esm/*.test.mjs",
52-
"test:watch": "vitest"
48+
"test": "vitest run __tests__",
49+
"test:browser": "npm test -- --config=vitest.browser.config.mts --browser=chromium",
50+
"test:ci": "CI=true npm test -- --color",
51+
"test:esm": "npm run build:esm && node --test test/esm/*",
52+
"test:watch": "vitest __tests__ --coverage.enabled=false"
5353
},
5454
"repository": {
5555
"type": "git",

vitest.browser.config.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default mergeConfig(
88
defineConfig({
99
test: {
1010
globals: true,
11+
coverage: {
12+
enabled: false,
13+
},
1114
browser: {
1215
enabled: true,
1316
provider: playwright(),
@@ -18,7 +21,7 @@ export default mergeConfig(
1821
{ browser: 'webkit' },
1922
],
2023
},
21-
include: ['test/client/**'],
24+
exclude: ['__tests__/server/server.test.ts'],
2225
},
2326
}),
2427
);

vitest.config.mts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ export default defineConfig({
1313
statements: 100,
1414
},
1515
},
16-
include: ['**/__tests__/**/*.test.?(m)[jt]s'],
17-
exclude: ['**/__tests__/(esm|types)/**'],
16+
exclude: ['__tests__/(esm|types)/**'],
1817
reporters:
1918
process.env.CI === 'true' ? ['default', 'github-actions'] : ['default'],
2019
},

0 commit comments

Comments
 (0)