-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathvitest.config.js
More file actions
87 lines (84 loc) · 2.54 KB
/
Copy pathvitest.config.js
File metadata and controls
87 lines (84 loc) · 2.54 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import vue from "@vitejs/plugin-vue";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const sharedAlias = {
"intl-tel-input/intlTelInputWithUtils": path.resolve(__dirname, "packages/core/dist/js/intlTelInputWithUtils.mjs"),
"intl-tel-input/utils": path.resolve(__dirname, "packages/core/dist/js/utils.js"),
"intl-tel-input": path.resolve(__dirname, "packages/core/dist/js/intlTelInput.mjs"),
};
export default defineConfig({
resolve: { alias: sharedAlias },
define: {
"process.env.NODE_ENV": JSON.stringify("test"),
},
optimizeDeps: {
include: [
"@angular/compiler",
"@angular/core",
"@angular/core/testing",
"@angular/platform-browser/testing",
"@testing-library/vue",
"@testing-library/svelte",
"zone.js",
"zone.js/testing",
],
esbuildOptions: {
define: {
"process.env.NODE_ENV": JSON.stringify("test"),
"process.env": "({})",
"process": "({env:{}})",
},
},
},
test: {
globals: true,
coverage: {
provider: "v8",
include: ["packages/core/src/js/**/*.ts"],
exclude: ["packages/core/src/js/locale/**", "packages/core/src/js/types/**"],
reporter: ["text", "html", "lcov"],
reportsDirectory: "coverage",
},
projects: [
{
resolve: { alias: sharedAlias },
test: {
globals: true,
name: "node",
include: ["tests/**/*.test.js"],
exclude: ["tests/integration/react/**"],
pool: "forks",
forks: { execArgv: ["--disable-warning=DEP0040"] },
},
},
{
resolve: { alias: sharedAlias },
plugins: [vue(), svelte()],
test: {
globals: true,
name: "browser",
include: [
"tests/integration/react/**/*.test.{js,jsx}",
"tests/integration/vue/**/*.test.{js,ts}",
"tests/integration/svelte/**/*.test.{js,ts}",
"tests/integration/angular/**/*.test.ts",
],
setupFiles: [
"tests/integration/process-shim.ts",
"tests/integration/angular/setup.ts",
],
browser: {
enabled: true,
provider: playwright(),
headless: true,
instances: [{ browser: "chromium" }],
},
},
},
],
},
});