mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[test:server] include Kibana node_modules/.bin in path when running server tests
Original commit: elastic/kibana-plugin-helpers@bbda801351
This commit is contained in:
parent
b450b38f87
commit
b2369866d2
1 changed files with 7 additions and 1 deletions
|
@ -1,13 +1,19 @@
|
|||
module.exports = function (plugin) {
|
||||
var resolve = require('path').resolve;
|
||||
var delimiter = require('path').delimiter;
|
||||
var execFileSync = require('child_process').execFileSync;
|
||||
|
||||
var kibanaBins = resolve(plugin.kibanaRoot, 'node_modules/.bin');
|
||||
var mochaSetupJs = resolve(plugin.kibanaRoot, 'test/mocha_setup.js');
|
||||
|
||||
var cmd = 'mocha';
|
||||
var args = ['--require', mochaSetupJs, 'server/**/__tests__/**/*.js'];
|
||||
var path = `${kibanaBins}${delimiter}${process.env.PATH}`;
|
||||
execFileSync(cmd, args, {
|
||||
cwd: plugin.root,
|
||||
stdio: 'inherit'
|
||||
stdio: 'inherit',
|
||||
env: Object.assign({}, process.env, {
|
||||
PATH: path
|
||||
})
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue