-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwallaby.js
executable file
·86 lines (70 loc) · 1.49 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
var path = require('path')
var fs = require('fs')
module.exports = function (wallaby) {
return {
projectRoot: __dirname,
/**
* Regular modules
*/
files: [
'typings/browser.d.ts',
'src/**/*.ts',
'!src/**/*.spec.ts',
{ pattern: 'src/test/fixtures/*.ts', instrument:false }
],
/**
* Tests
*/
tests: [
'src/**/*.spec.ts'
],
// Mocha
testFramework: "mocha",
env: {
type: 'node'
// ,
// params: {
// env:'DEBUG=true;NODE_PATH=' + nodePath
//}
},
// In order to get everything to work it has to
// go through babel - this needs to be fixed at somepont
compilers: {
'**/*.ts': wallaby.compilers.typeScript({
typescript: require('typescript'),
module: 5, // ES6
target: 2, // ES6
emitDecoratorMetadata: true,
experimentalDecorators: true,
preserveConstEnums: true,
allowSyntheticDefaultImports: true,
jsx: 'react'
})
},
preprocessors: {
'**/*.js': file => {
return require('babel-core')
.transform(
file.content,
JSON.parse(fs.readFileSync('./.babelrc','utf-8'))
)
}
},
delays: {
edit: 500,
run: 150
},
workers: {
initial: 1,
regular: 1
},
// Override the global Promise
bootstrap: function() {
var path = require('path')
var mochaPath = path.join(wallaby.localProjectDir, 'src','test','mocks','test-setup')
//console.log('mocha path', mochaPath)
global.assert = require('assert')
require('./src/test/mocks/test-setup')
}
}
}