forked from swiftlang/vscode-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vscode-test.js
65 lines (60 loc) · 2.07 KB
/
.vscode-test.js
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
//===----------------------------------------------------------------------===//
//
// This source file is part of the VS Code Swift open source project
//
// Copyright (c) 2024 the VS Code Swift project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of VS Code Swift project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
const { defineConfig } = require("@vscode/test-cli");
const isCIBuild = process.env["CI"] === "1";
const isFastTestRun = process.env["FAST_TEST_RUN"] === "1";
// "env" in launch.json doesn't seem to work with vscode-test
const isDebugRun = !(process.env["_"] ?? "").endsWith("node_modules/.bin/vscode-test");
// so tests don't timeout when a breakpoint is hit
const timeout = isDebugRun ? Number.MAX_SAFE_INTEGER : 3000
module.exports = defineConfig({
tests: [
{
label: "integrationTests",
files: ["out/test/suite/**/*.test.js"],
version: "stable",
workspaceFolder: "./assets/test",
mocha: {
ui: "tdd",
color: true,
timeout,
forbidOnly: isCIBuild,
grep: isFastTestRun ? "@slow" : undefined,
invert: isFastTestRun,
slow: 10000
},
installExtensions: ["vadimcn.vscode-lldb"],
reuseMachineInstall: !isCIBuild,
},
{
label: "unitTests",
files: ["out/test/unit-tests/**/*.test.js"],
version: "stable",
mocha: {
ui: "tdd",
color: true,
timeout,
forbidOnly: isCIBuild,
slow: 100
},
reuseMachineInstall: !isCIBuild,
},
// you can specify additional test configurations, too
],
coverage: {
includeAll: true,
exclude: ["**/test/**"],
reporter: ["text", "lcov"], // "lcov" also generates HTML
},
});