-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwallaby.js
41 lines (36 loc) · 1.03 KB
/
wallaby.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
module.exports = function (w) {
return {
files: [
"src/**/*.ts",
"src/**/*.js",
"src/**/*.json",
"!src/__tests__/unit/**/*.ts",
"tsconfig.json",
],
tests: ["src/__tests__/unit/**/*.ts"],
testFramework: "mocha",
compilers: {
"**/*.ts": w.compilers.typeScript({
noResolve: false,
}),
},
env: {
type: "node",
},
setup: function () {
// Enable TypeScript aliases
if (global._tsconfigPathsRegistered) return;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const tsConfigPaths = require("tsconfig-paths");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const tsconfig = require("./tsconfig.json");
tsConfigPaths.register({
baseUrl: tsconfig.compilerOptions.baseUrl,
paths: tsconfig.compilerOptions.paths,
});
global._tsconfigPathsRegistered = true;
// Ensure MockFs has fully reset before starting
require("mock-fs").restore();
},
};
};