mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
18 lines
511 B
JavaScript
18 lines
511 B
JavaScript
module.exports = function testBrowserAction(plugin, run, command) {
|
|
var execFileSync = require('child_process').execFileSync;
|
|
command = command || {};
|
|
|
|
var kbnServerArgs = [
|
|
'--kbnServer.testsBundle.pluginId=' + plugin.id,
|
|
'--kbnServer.plugin-path=' + plugin.root
|
|
];
|
|
|
|
var cmd = 'npm';
|
|
var task = (command.dev) ? 'test:dev' : 'test:browser';
|
|
var args = ['run', task, '--'].concat(kbnServerArgs);
|
|
execFileSync(cmd, args, {
|
|
cwd: plugin.kibanaRoot,
|
|
stdio: ['ignore', 1, 2]
|
|
});
|
|
|
|
};
|