-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathvitest.config.ts
44 lines (42 loc) · 1.02 KB
/
vitest.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//import babel from "vite-plugin-babel";
import { configDefaults, defineConfig } from "vitest/config"; // eslint-disable-line import/no-unresolved
import { getRollupAliasEntries } from "./tools/lib/rollupConfig";
const footballTests = ["**/*.football/*.test.ts", "**/*.football.test.ts"];
export default defineConfig({
// This can be used with vite-plugin-babel for babel-plugin-sport-functions, but it's not necessary and it slows the tests down
/*plugins: [
babel({
filter: /\.[cjt]sx?$/,
}),
],*/
resolve: {
alias: getRollupAliasEntries("test"),
},
test: {
isolate: false,
setupFiles: ["./src/test/setup.ts", "./src/worker/index.ts"],
workspace: [
{
extends: true,
test: {
name: "basketball",
env: {
SPORT: "basketball",
},
include: ["**/*.test.ts"],
exclude: [...configDefaults.exclude, ...footballTests],
},
},
{
extends: true,
test: {
name: "football",
env: {
SPORT: "football",
},
include: footballTests,
},
},
],
},
});