File size: 464 Bytes
cbc76af | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 'use strict';
const stripAnsi = require('strip-ansi');
const {resolve} = require('path');
const {execSync} = require('child_process');
const executable = require.resolve('../../bin/mocha');
const flag = '--help';
/**
* Return the output of `mocha --help` for display
*/
module.exports = () => {
return stripAnsi(
String(
execSync(`"${process.execPath}" ${executable} ${flag}`, {
cwd: resolve(__dirname, '..')
})
).trim()
);
};
|