forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.browser.shared.config.ts
49 lines (46 loc) · 1.2 KB
/
vitest.browser.shared.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
45
46
47
48
49
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { defineConfig } from "vitest/config";
import browserMap from "@azure-tools/vite-plugin-browser-test-map";
import { relativeRecordingsPath } from "@azure-tools/test-recorder";
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
export default defineConfig({
define: {
"process.env": process.env,
},
optimizeDeps: {
include: ["@azure-tools/test-recorder"],
},
test: {
testTimeout: 18000,
reporters: ["verbose", "junit"],
outputFile: {
junit: "test-results.browser.xml",
},
browser: {
enabled: true,
headless: true,
name: "chromium",
provider: "playwright",
providerOptions: {
launch: {
args: ["--disable-web-security"],
},
},
},
fakeTimers: {
toFake: ["setTimeout"],
},
watch: false,
coverage: {
include: ["dist-test/browser/**/*.js"],
exclude: [
"dist-test/browser/**/*./*-browser.mjs",
"dist-test/browser/**/*./*-react-native.mjs",
],
provider: "istanbul",
reporter: ["text", "json", "html"],
reportsDirectory: "coverage-browser",
},
},
});