-
Notifications
You must be signed in to change notification settings - Fork 1
/
wallaby.js
66 lines (55 loc) · 1.97 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
62
63
64
65
66
module.exports = function (wallaby) {
const path = require('path');
process.env.NODE_PATH +=
path.delimiter +
path.join(__dirname, 'node_modules');
return {
hints: {
ignoreCoverage: /istanbul ignore next/
},
files: [
'src/**/*.ts',
'src/**/*.tsx',
'src/**/*.js',
'!src/**/__tests__/*.ts',
'!src/**/__tests__/*.tsx'
],
tests: [
'src/**/__tests__/*.spec.ts',
'src/**/__tests__/*.spec.tsx',
'util/**/__tests/*.spec.js'
],
env: {
type: 'node',
runner: 'node'
},
testFramework: 'jest',
setup: () => {
global.__DEV__ = true;
global.__TEST__ = true;
global.window = global;
window.addEventListener = () => {};
window.requestAnimationFrame = () => {
throw new Error('requestAnimationFrame is not supported in Node');
};
wallaby.testFramework.configure({
moduleNameMapper: {
'^react-native$': 'react-native-web'
}
});
},
compilers: {
'**/*.ts': wallaby.compilers.typeScript(require('./tsconfig.json')),
'**/*.tsx': wallaby.compilers.typeScript(require('./tsconfig.json')),
'**/*.js': wallaby.compilers.babel({
babel: require('babel-core'),
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
})
}
};
};