UNPKG

1.62 kBJavaScriptView Raw
1
2module.exports = function (wallaby) {
3 return {
4 files: [
5 {
6 pattern: 'package.json',
7 instrument: false
8 },
9 {
10 pattern: 'config.tpl.js',
11 instrument: false
12 },
13 {
14 pattern: 'test/unit/certificates/server.key',
15 instrument: false
16 },
17 {
18 pattern: 'test/unit/certificates/server.crt',
19 instrument: false
20 },
21 {
22 pattern: 'test/unit/**/*.spec.js',
23 ignore: true
24 },
25 'lib/**/*.js',
26 'test/unit/**/*.js',
27 'test/unit/mocha-globals.js'
28 ],
29
30 tests: [
31 'test/unit/**/*.spec.js'
32 ],
33
34 bootstrap: function (w) {
35 var path = require('path')
36 var mocha = w.testFramework
37
38 mocha.suite.on('pre-require', function () {
39 // always passing wallaby.js globals to mocks.loadFile
40 var mocks = require('mocks')
41 var loadFile = mocks.loadFile
42 mocks.loadFile = function (filePath, mocks, globals, mockNested) {
43 mocks = mocks || {}
44 globals = globals || {}
45 globals.$_$wp = global.$_$wp || {}
46 globals.$_$wpe = global.$_$wpe || {}
47 globals.$_$w = global.$_$w || {}
48 globals.$_$wf = global.$_$wf || {}
49 globals.$_$tracer = global.$_$tracer || {}
50 return loadFile(filePath, mocks, globals, mockNested)
51 }
52
53 // loading mocha-globals for each run
54 require(path.join(process.cwd(), 'test/unit/mocha-globals'))
55 })
56 },
57
58 env: {
59 type: 'node',
60 params: {
61 runner: '--harmony --harmony_arrow_functions'
62 }
63 }
64 }
65}