-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
56 lines (52 loc) · 1.65 KB
/
vitest.config.js
File metadata and controls
56 lines (52 loc) · 1.65 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
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { playwright } from "@vitest/browser-playwright";
import { defineConfig } from "vite";
const __dirname = dirname(fileURLToPath(import.meta.url));
const $ = ({ page, provider }, selector) => {
if (provider.name !== "playwright") {
throw new Error(`Provider "${provider.name}" is not supported`);
}
return page.locator(selector);
};
export default defineConfig(({ mode }) => ({
optimizeDeps: {
include: [
"@open-wc/lit-helpers",
"vitest-browser-lit",
"@lit/localize",
"lit",
"date-fns",
"lit/directives/if-defined.js",
"lit/decorators/property.js",
"lit/decorators.js",
"@patternfly/pfe-core/controllers/internals-controller.js",
"@patternfly/pfe-core/decorators/observed.js",
"ts-pattern",
],
},
test: {
alias: {
"@goauthentik/elements": resolve(__dirname, "./dist"),
},
dir: "./dist",
include: ["**/*.test.js"],
browser: {
enabled: true,
instances: [{ browser: "chromium" }],
provider: playwright(),
headless: "CI" in process.env,
locators: {
testIdAttribute: "data-ouia-component-type",
},
commands: {
$: $,
},
},
css: {
include: true,
},
setupFiles: ["./config/vitest.setup.js"],
reporters: process.env.GITHUB_ACTIONS ? ["github-actions", "default"] : ["default"],
},
}));