-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallaby.js
51 lines (46 loc) · 1.29 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
module.exports = function (wallaby) {
const tsConfig = require('./tsconfig.json');
const contractPathExp = 'src/**/*.contract.ts?(x)';
const testPathExp = 'src/**/*.spec.ts?(x)';
const JScontractPathExp = 'src/**/*.contract.js?(x)';
const JStestPathExp = 'src/**/*.spec.js?(x)';
return {
files: [
'tsconfig.json',
'config/jest/*.js',
'src/**/*.+(js|jsx|ts|tsx|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)',
`!${contractPathExp}`,
`!${testPathExp}`,
`!${JScontractPathExp}`,
`!${JStestPathExp}`,
],
tests: [
testPathExp,
contractPathExp,
JScontractPathExp,
JStestPathExp
],
env: {
type: 'node',
runner: 'node'
},
testFramework: 'jest',
compilers: {
'**/*.js?(x)': wallaby.compilers.babel({
babel: require('babel-core'),
presets: ["react"],
plugins: [
"transform-class-properties",
"transform-object-rest-spread",
]
}),
'**/*.ts?(x)': wallaby.compilers.typeScript(tsConfig.compilerOptions),
},
setup: function (wallaby) {
var jestConfig = require('./package.json').jest;
// for example:
// jestConfig.globals = { "__DEV__": true };
wallaby.testFramework.configure(jestConfig);
}
};
};