1 | module.exports = function () {
|
2 | return {
|
3 | files: [
|
4 | {
|
5 | pattern: 'package.json',
|
6 | instrument: false
|
7 | },
|
8 | {
|
9 | pattern: 'config.tpl.js',
|
10 | instrument: false
|
11 | },
|
12 | 'lib/**/*.js',
|
13 | 'test/unit/**/*.js',
|
14 | 'test/unit/mocha-globals.coffee'
|
15 | ],
|
16 |
|
17 | tests: [
|
18 | 'test/unit/**/*.spec.coffee'
|
19 | ],
|
20 |
|
21 | bootstrap: function (w) {
|
22 | var path = require('path');
|
23 | var mocha = w.testFramework;
|
24 |
|
25 | mocha.suite.on('pre-require', function () {
|
26 |
|
27 |
|
28 | var mocks = require('mocks');
|
29 | var loadFile = mocks.loadFile;
|
30 | mocks.loadFile = function (filePath, mocks, globals, mockNested) {
|
31 | mocks = mocks || {};
|
32 | globals = globals || {};
|
33 | globals.$_$wp = global.$_$wp;
|
34 | globals.$_$w = global.$_$w;
|
35 | globals.$_$wf = global.$_$wf;
|
36 | globals.$_$tracer = global.$_$tracer;
|
37 | return loadFile(filePath, mocks, globals, mockNested);
|
38 | };
|
39 |
|
40 |
|
41 | require(path.join(process.cwd(), 'test/unit/mocha-globals'));
|
42 | });
|
43 | },
|
44 |
|
45 | env: {
|
46 | type: 'node'
|
47 | }
|
48 | };
|
49 | }; |
\ | No newline at end of file |