mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
25 lines
638 B
JavaScript
25 lines
638 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
export function runMocha() {
|
|
const debugInBand = process.execArgv.some(arg => {
|
|
switch (arg) {
|
|
case '--debug':
|
|
case '--debug-brk':
|
|
case '-d':
|
|
case '--inspect':
|
|
case '--inspect-brk':
|
|
return true;
|
|
}
|
|
});
|
|
|
|
if (debugInBand) {
|
|
process.argv.push('--no-timeouts');
|
|
require('mocha/bin/_mocha');
|
|
} else {
|
|
require('mocha/bin/mocha');
|
|
}
|
|
}
|