mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-09-11 12:25:59 +03:00
Add --grep flag to gulp test task (passed to mocha --grep)
This commit is contained in:
parent
c5469dcbfe
commit
1cf8dc70d1
26
gulpfile.js
26
gulpfile.js
@ -178,6 +178,12 @@ gulp.task('forceprettier', function(done) {
|
||||
|
||||
// test
|
||||
gulp.task('test', function(done) {
|
||||
var knownOptions = {
|
||||
string: 'grep',
|
||||
default: { grep: '' },
|
||||
};
|
||||
var options = minimist(process.argv.slice(2), knownOptions);
|
||||
|
||||
var spawn = require('child_process').spawn;
|
||||
const dockerTag = 'vscodevim';
|
||||
|
||||
@ -201,10 +207,22 @@ gulp.task('test', function(done) {
|
||||
}
|
||||
|
||||
console.log('Running tests inside container...');
|
||||
var dockerRunCmd = spawn('docker', ['run', '-it', '-v', process.cwd() + ':/app', dockerTag], {
|
||||
cwd: process.cwd(),
|
||||
stdio: 'inherit',
|
||||
});
|
||||
var dockerRunCmd = spawn(
|
||||
'docker',
|
||||
[
|
||||
'run',
|
||||
'-it',
|
||||
'--env',
|
||||
`MOCHA_GREP=${options.grep}`,
|
||||
'-v',
|
||||
process.cwd() + ':/app',
|
||||
dockerTag,
|
||||
],
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
|
||||
dockerRunCmd.on('exit', function(exitCode) {
|
||||
done(exitCode);
|
||||
|
@ -17,10 +17,14 @@ Globals.mockConfiguration = new Configuration();
|
||||
|
||||
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
|
||||
var testRunner = require('vscode/lib/testrunner');
|
||||
testRunner.configure({
|
||||
const mochaGrep = new RegExp(process.env.MOCHA_GREP || '');
|
||||
const testRunnerConfiguration = {
|
||||
ui: 'tdd',
|
||||
useColors: true,
|
||||
timeout: 10000,
|
||||
});
|
||||
grep: mochaGrep,
|
||||
};
|
||||
|
||||
testRunner.configure(testRunnerConfiguration);
|
||||
|
||||
module.exports = testRunner;
|
||||
|
Loading…
Reference in New Issue
Block a user