forked from neo-one-suite/neo-one
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallaby.js
64 lines (64 loc) · 2.31 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
module.exports = function(wallaby) {
return {
files: [
{ pattern: 'jest/**/*', instrument: false },
{ pattern: 'scripts/serializers/**/*.js', instrument: false },
{ pattern: 'scripts/test/jestSetup.js', instrument: false },
{ pattern: 'package.json', instrument: false },
{ pattern: 'packages/*/package.json', instrument: false },
{ pattern: 'tsconfig.json', instrument: false },
{ pattern: 'packages/*/tsconfig.json', instrument: false },
'packages/*/src/**/*.ts?(x)',
'packages/*/src/**/*.snap',
'!packages/neo-one-server/src/**/*.ts?(x)',
'!packages/neo-one-server-client/src/**/*.ts?(x)',
'!packages/neo-one-server-plugin/src/**/*.ts?(x)',
'!packages/neo-one-server-plugin-*/src/**/*.ts?(x)',
'!packages/neo-one-cli/src/**/*.ts?(x)',
'!packages/*/src/**/*.test.ts?(x)',
'!packages/*/src/__e2e__/**/*',
],
tests: ['packages/*/src/**/__tests__/**/*.test.ts?(x)'],
env: {
type: 'node',
runner: 'node',
},
testFramework: 'jest',
compilers: {
'**/*.ts?(x)': wallaby.compilers.typeScript({
...require('./tsconfig.json').compilerOptions,
...require('./tsconfig/tsconfig.build.json').compilerOptions,
...require('./tsconfig/tsconfig.cjs.json').compilerOptions,
...require('./tsconfig/tsconfig.es2017.cjs.json').compilerOptions,
...require('./tsconfig.jest.json').compilerOptions,
}),
},
preprocessors: {
'**/*.test.js?(x)': (file) =>
require('@babel/core').transform(file.content, {
sourceMap: true,
filename: file.path,
plugins: ['babel-plugin-jest-hoist'],
}),
},
setup: function(wallaby) {
var jestConfig = require('./jest/unit.js');
jestConfig.moduleNameMapper = {
'^@neo-one/ec-key': '@neo-one/ec-key',
'^@neo-one/boa': '@neo-one/boa',
'^@neo-one/csharp': '@neo-one/csharp',
'^@neo-one/(.+)': wallaby.projectCacheDir + '/packages/neo-one-$1/src',
};
jestConfig.transform = {};
delete jestConfig.rootDir;
wallaby.testFramework.configure(jestConfig);
},
hints: {
testFileSelection: {
include: /wallaby\.only/,
exclude: /wallaby\.skip/,
},
ignoreCoverage: /istanbul ignore next/,
},
};
};