Skip to content

Commit

Permalink
use `--forbid-only in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Nov 29, 2018
1 parent 9f02180 commit 7969028
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const path = require('path');
function test(testName, mochaParams) {
const coverageCommand = `nyc --no-clean --report-dir coverage/reports/${testName}`;
const mochaCommand = `node ${path.join('bin', 'mocha')}`; // Include 'node' and path.join for Windows compatibility
if (process.env.CI && !/^only-/.test(testName)) {
mochaParams += ' --forbid-only';
}
return `${
process.env.COVERAGE ? coverageCommand : ''
} ${mochaCommand} ${mochaParams}`.trim();
Expand Down Expand Up @@ -196,23 +199,23 @@ module.exports = {
},
globalBdd: {
script: test(
'global-only-bdd',
'only-global-bdd',
'--ui bdd test/only/global/bdd.spec'
),
description: 'Run Node.js "global only" w/ BDD interface tests',
hiddenFromHelp: true
},
globalTdd: {
script: test(
'global-only-tdd',
'only-global-tdd',
'--ui tdd test/only/global/tdd.spec'
),
description: 'Run Node.js "global only" w/ TDD interface tests',
hiddenFromHelp: true
},
globalQunit: {
script: test(
'global-only-qunit',
'only-global-qunit',
'--ui qunit test/only/global/qunit.spec'
),
description: 'Run Node.js "global only" w/ QUnit interface tests',
Expand Down

0 comments on commit 7969028

Please sign in to comment.