-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
wallaby.js
61 lines (59 loc) · 1.47 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import * as path from 'node:path';
import * as url from 'node:url';
export default function w (wallaby) {
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
return {
testFramework: 'mocha',
files: [
'public/v1/*',
'src/**/*.ts',
'src/**/*.cjs',
'src/**/*.json',
'config/*',
'public/**/*.yaml',
'seeds/**/*',
'migrations/**/*',
'test/utils/**/*.ts',
'test/mocks/**/*',
'test/plugins/**/*',
'test/setup.ts',
'test/types.ts',
'package.json',
'knexfile.js',
'data/GCP_IP_RANGES.json',
'data/AWS_IP_RANGES.json',
'data/DOMAIN_BLACKLIST.json',
'data/IP_BLACKLIST.json',
'data/GEONAMES_CITIES.csv',
'data/LAST_API_COMMIT_HASH.txt',
],
tests: [
'test/tests/integration/**/*.test.ts',
'test/tests/unit/**/*.test.ts',
],
setup (w) {
const path = require('path');
w.testFramework.files.unshift(path.resolve(process.cwd(), 'test/setup.js'));
const mocha = w.testFramework;
mocha.timeout(10000);
},
env: {
type: 'node',
params: {
runner: '--experimental-specifier-resolution=node --loader '
+ url.pathToFileURL(path.join(__dirname, 'node_modules/testdouble/lib/index.mjs')),
env: 'NODE_ENV=test;TEST_MODE=unit',
},
},
compilers: {
'**/*.ts?(x)': wallaby.compilers.typeScript({
module: 'ESNext',
}),
},
preprocessors: {
'**/*.ts': file => file.content.replace(/\.ts/g, '.js'),
},
workers: { restart: true, initial: 1, regular: 1 },
runMode: 'onsave',
};
}