-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathvitest.browser.base.config.ts
More file actions
68 lines (65 loc) · 1.75 KB
/
vitest.browser.base.config.ts
File metadata and controls
68 lines (65 loc) · 1.75 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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { defineConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import browserMap from "@azure-tools/vite-plugin-browser-test-map";
import {
AzureSDKReporter,
makeAliases,
fixCoreLroExternalization,
} from "./vitest.shared.config.js";
function makeBrowserAliases(rootDir: string) {
return makeAliases(rootDir, { distDir: `./dist/browser`, indexFile: `index.js` });
}
export default defineConfig({
plugins: [fixCoreLroExternalization()],
define: {
"process.env": process.env,
},
test: {
testTimeout: 1200000,
hookTimeout: 1200000,
reporters: [new AzureSDKReporter(), "junit"],
outputFile: {
junit: "test-results.browser.xml",
},
include: ["dist-test/**/*.spec.js"],
exclude: [
"dist-test/**/node/*.spec.js",
"dist-test/snippets.spec.js",
"dist-test/integration/**/*.spec.js",
"dist-test/stress/**/*.js",
],
browser: {
api: 43315,
instances: [
{
browser: "chromium",
},
],
enabled: true,
headless: true,
provider: playwright({
launchOptions: {
args: ["--disable-web-security"],
},
}),
},
fakeTimers: {
toFake: ["setTimeout", "Date"],
},
watch: false,
alias: [...makeBrowserAliases(process.cwd())],
coverage: {
include: ["dist-test/browser/**/*.js"],
exclude: [
"dist-test/browser/**/*./*-browser.mjs",
"dist-test/browser/**/*./*-react-native.mjs",
"dist-test/browser/**/snippets.spec.js",
],
provider: "istanbul",
reporter: ["text", "cobertura", "html"],
reportsDirectory: "coverage-browser",
},
},
});