-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to not fail on failing test suite (#4771)
* Add option fail-on-failing-test-suite to not fail test run if there were no infrastructure problem * Add test on failOnFailingTestSuite * Use parameters which by default is false * Update docs/index.md * refactor: shared clampedCode --------- Co-authored-by: Josh Goldberg <[email protected]>
- Loading branch information
1 parent
9a1c458
commit deb8679
Showing
8 changed files
with
126 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
var assert = require('assert'); | ||
|
||
describe('a suite', function() { | ||
it('should succeed', function() { | ||
assert(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
var helpers = require('../helpers'); | ||
var runMochaJSON = helpers.runMochaJSON; | ||
|
||
describe('Enabled --pass-on-failing-test-suite', function() { | ||
var args = ['--pass-on-failing-test-suite=true']; | ||
|
||
it('Test should finish with zero code with disabled option', function(done) { | ||
var fixture = 'failing-sync.fixture.js'; | ||
runMochaJSON(fixture, args, function(err, res) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
expect(res, 'to have passed test count', 0) | ||
.and('to have test count', 1) | ||
.and('to have exit code', 0); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Disabled --pass-on-failing-test-suite', function() { | ||
var args = ['--pass-on-failing-test-suite=false']; | ||
|
||
it('Test should return non-zero code with enabled option', function(done) { | ||
var fixture = 'failing-sync.fixture.js'; | ||
runMochaJSON(fixture, args, function(err, res) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
expect(res, 'to have passed test count', 0) | ||
.and('to have test count', 1) | ||
.and('to have exit code', 1); | ||
done(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters