forked from mybuilder/fetch-oauth2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wallaby.js
57 lines (50 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
var babel = require('babel');
var wallabyWebpack = require('wallaby-webpack');
var webpack = require('webpack');
var wallabyPostprocessor = wallabyWebpack({
resolve: {
modulesDirectories: ['node_modules', "src", "spec-tools"],
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{test: /\.json$/, loader: "json-loader"}
]
},
plugins: [
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
]
});
module.exports = function (wallaby) {
return {
files: [
{pattern: 'node_modules/babel-core/browser-polyfill.js', instrument: false},
{pattern: 'src/**/*.js', load: false},
{pattern: 'test_server_port.json', load: false}
],
tests: [
{pattern: 'spec/**/*Spec.js', load: false}
],
compilers: {
'**/*.js': wallaby.compilers.babel({
babel: babel,
// https://babeljs.io/docs/usage/experimental/
stage: 0
})
},
env: {
type: "browser",
params: {
runner: '--local-to-remote-url-access=true --web-security=false'
}
},
testFramework: 'mocha',
postprocessor: wallabyPostprocessor,
bootstrap: function () {
// required to trigger tests loading
window.__moduleBundler.loadTests();
}
};
};