This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.values.cjs
97 lines (86 loc) · 2.19 KB
/
.values.cjs
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
88
89
90
91
92
93
94
95
96
97
"use strict";
const process = require("node:process");
const testSuffix = "test";
const testTypeTests = "tests";
const testTypeEndToEnd = "end-to-end";
const testTypePerformance = "performance";
const testTypeIntegration = "integration";
const testTypeUnit = "unit";
const cacheDir = ".cache";
const compiledDir = "{build,lib}";
const dependenciesDir = "node_modules";
const githubDir = ".github";
const packagesDir = "packages";
const scriptsDir = "scripts";
const srcDir = "src";
const reportsDir = "_reports";
const tempDir = ".temp";
const testDataDir = "testdata";
const testsDir = "__tests__";
const _testDirUnit = "unit";
const testDirCommon = "common";
const testDirEndToEnd = "e2e";
const testDirIntegration = "integration";
const testDirPerformance = "performance";
const testDirAll = `{${[
testDirCommon,
testDirIntegration,
_testDirUnit,
].join(",")}}`;
const testDirUnit = `{${[
testDirCommon,
_testDirUnit,
].join(",")}}`;
let packagesExpr = "*";
let packagesList = [packagesExpr];
if (process.env.TEST_PACKAGES !== undefined) {
packagesExpr = process.env.TEST_PACKAGES;
packagesList = process.env.TEST_PACKAGES.split(",");
if (packagesList.length > 1) {
packagesExpr = `{${packagesExpr}}`;
}
}
const packagesCoverageExclusions = [];
if (packagesList.includes("cli")) {
packagesCoverageExclusions.push(`${packagesDir}/cli/${srcDir}/index.ts`);
packagesCoverageExclusions.push(`${packagesDir}/cli/${srcDir}/main.ts`);
}
function getAllPackagesAsArray() {
const fs = require("node:fs");
const path = require("node:path");
const absPackagesDir = path.resolve(__dirname, "packages");
const packagesArray = fs.readdirSync(absPackagesDir);
return packagesArray;
}
module.exports = {
// Directories
cacheDir,
compiledDir,
dependenciesDir,
githubDir,
packagesDir,
reportsDir,
scriptsDir,
srcDir,
tempDir,
testDataDir,
testDirAll,
testDirCommon,
testDirEndToEnd,
testDirIntegration,
testDirPerformance,
testDirUnit,
testsDir,
// Computed
getAllPackagesAsArray,
packagesCoverageExclusions,
packagesExpr,
packagesList,
// Tests
testSuffix,
testTypeEndToEnd,
testTypePerformance,
testTypeIntegration,
testTypeTests,
testTypeUnit,
};