mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[mocha] move setup work into module
with https://github.com/elastic/kibana/pull/5553 we added command line flags the told mocha it was supposed to use babel. This changes the strategy here and instead uses mocha's -r option (and it's mocha.opts file to specify it). This means that using mocha directly from the command line still works, and that we have a place where we can do other setup work.
This commit is contained in:
parent
8e1e85148f
commit
c87aec3dae
4 changed files with 12 additions and 2 deletions
|
@ -55,8 +55,8 @@
|
|||
"elasticsearch": "grunt esvm:dev:keepalive",
|
||||
"lint": "grunt eslint:source",
|
||||
"lintroller": "grunt eslint:fixSource",
|
||||
"mocha": "mocha --compilers js:babel/register",
|
||||
"mocha:debug": "mocha --debug-brk --compilers js:babel/register"
|
||||
"mocha": "mocha",
|
||||
"mocha:debug": "mocha --debug-brk"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
var wrap = require('lodash').wrap;
|
||||
var Mocha = require('mocha');
|
||||
|
||||
Mocha.prototype.run = wrap(Mocha.prototype.run, function (orig) {
|
||||
require('../../test/mocha_setup');
|
||||
orig.call(this);
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
options: {
|
||||
timeout: 10000,
|
||||
|
|
1
test/mocha.opts
Normal file
1
test/mocha.opts
Normal file
|
@ -0,0 +1 @@
|
|||
-r test/mocha_setup.js
|
1
test/mocha_setup.js
Normal file
1
test/mocha_setup.js
Normal file
|
@ -0,0 +1 @@
|
|||
require('babel/register')(require('../src/optimize/babelOptions').node);
|
Loading…
Add table
Add a link
Reference in a new issue