forked from felixrieseberg/windows-build-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wallaby.js
54 lines (46 loc) · 1.21 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
module.exports = (wallaby) => ({
files: [
'src/**/*.js?(x)',
'src/**/*.ts?(x)',
'src/**/*.html',
{ pattern: '__tests__/**/*-test.ts?(x)', ignore: true },
{ pattern: '__tests__/**/!(*-test)', instrument: false, load: true },
{ pattern: 'package.json', instrument: false, load: true }
],
tests: [
'__tests__/**/*-test.ts?(x)'
],
env: {
type: 'node',
runner: 'node',
params: { env: 'wallaby=true' }
},
testFramework: 'jest',
// Enable mock hoisting as same as ts-jest does
// (https://github.com/kulshekhar/ts-jest#supports-automatic-of-jestmock-calls)
preprocessors: {
'**/*.js?(x)': (file) => require('babel-core').transform(
file.content,
{ sourceMaps: true, filename: file.path, presets: ['babel-preset-jest'] })
},
workers: {
initial: 2,
regular: 1
},
setup: (w) => {
const path = require('path');
const jestConfig = {
resetMocks: true,
resetModules: true,
moduleFileExtensions: [
'js',
'jsx',
'json',
'ts',
'tsx'
],
globals: { __JEST_DEV__: true }
};
w.testFramework.configure(jestConfig);
}
});