-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
wallaby.js
41 lines (40 loc) · 1.1 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
import * as path from 'node:path';
import * as url from 'node:url';
export default function wallaby () {
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
return {
testFramework: 'mocha',
files: [
'src/**/*.ts',
'config/*',
'test/mocks/**/*',
'test/plugins/**/*',
'test/utils.ts',
'test/hooks.ts',
'test/setup.ts',
'test/snapshots/**/*.json',
'package.json',
],
tests: [
'test/unit/**/*.test.ts',
],
setup (w) {
const path = require('path');
w.testFramework.files.unshift(path.resolve(process.cwd(), 'test/hooks.js'));
w.testFramework.files.unshift(path.resolve(process.cwd(), 'test/setup.js'));
const mocha = w.testFramework;
mocha.timeout(5000);
},
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;NEW_RELIC_ENABLED=false;NEW_RELIC_LOG_ENABLED=false',
},
},
preprocessors: {
'**/*.ts': file => file.content.replace(/\.ts/g, '.js'),
},
workers: { restart: true },
};
}