Skip to content

Commit

Permalink
fixed: travis test
Browse files Browse the repository at this point in the history
  • Loading branch information
stoicchild8910 committed Aug 30, 2020
1 parent 8fd18d3 commit a2df93a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/cli/run-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ const parallelRun = async (mocha, options, fileCollectParams) => {
* @returns {Promise<Runner>}
*/
exports.runMocha = async (mocha, options) => {
let {
const {
watch = false,
extension = [],
ignore = [],
file = [],
parallel = false,
recursive = false,
sort = false,
spec = [],
parallelForce = false
} = options;
let {parallel} = options;

const fileCollectParams = {
ignore,
Expand All @@ -223,6 +223,7 @@ exports.runMocha = async (mocha, options) => {
parallel = false;
}
}

let run;
if (watch) {
run = parallel ? watchParallelRun : watchRun;
Expand Down
1 change: 1 addition & 0 deletions lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ exports.Test = require('./test');
* @param {number|string} [options.timeout] - Timeout threshold value.
* @param {string} [options.ui] - Interface name.
* @param {boolean} [options.parallel] - Run jobs in parallel
* @param {boolean} [options.parallelForce] - Run jobs in parallel
* @param {number} [options.jobs] - Max number of worker processes for parallel runs
* @param {MochaRootHookObject} [options.rootHooks] - Hooks to bootstrap the root
* suite with
Expand Down
2 changes: 1 addition & 1 deletion test/integration/options/jobs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('--jobs', function() {
return expect(
runMochaAsync(
'options/jobs/fail-in-parallel',
['--parallel', '--jobs', '2'],
['--parallel', '--parallelForce', '--jobs', '2'],
'pipe'
),
'when fulfilled',
Expand Down
6 changes: 5 additions & 1 deletion test/integration/options/parallel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ describe('--parallel', function() {
describe('when there is only a single test file', function() {
it('should fail gracefully', function() {
return expect(
runMochaAsync('options/parallel/syntax-err', ['--parallel']),
runMochaAsync('options/parallel/syntax-err', [
'--parallelForce',
'--parallel'
]),
'when fulfilled',
'to have failed with output',
/SyntaxError/
Expand Down Expand Up @@ -146,6 +149,7 @@ describe('--parallel', function() {
[
require.resolve('../fixtures/options/parallel/uncaught.fixture.js'),
'--parallel',
'--parallelForce',
'--allow-uncaught'
],
'pipe'
Expand Down

0 comments on commit a2df93a

Please sign in to comment.