forked from electron/fiddle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallaby.js
59 lines (51 loc) · 1.38 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
module.exports = (wallaby) => ({
files: [
'src/**/*.js?(x)',
'src/**/*.ts?(x)',
'src/**/*.html',
'tests/**/*.snap',
{ pattern: 'tests/**/*-spec.ts?(x)', ignore: true },
{ pattern: 'tests/**/!(*-spec)', instrument: false, load: true },
{ pattern: 'package.json', instrument: false, load: true }
],
tests: [
'tests/**/*-spec.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'
],
moduleNameMapper: {
".*releases.json$": path.join(wallaby.localProjectDir, 'static/releases.json'),
},
setupTestFrameworkScriptFile: path.join(wallaby.projectCacheDir, 'tests/setup.js'),
globals: { __JEST_DEV__: true }
};
w.testFramework.configure(jestConfig);
}
});