-
-
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.
Merge pull request #946 from cmbuckley/skip
Allow skip from test context for #332
- Loading branch information
Showing
5 changed files
with
100 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
/** | ||
* Expose `Pending`. | ||
*/ | ||
|
||
module.exports = Pending; | ||
|
||
/** | ||
* Initialize a new `Pending` error with the given message. | ||
* | ||
* @param {String} message | ||
*/ | ||
|
||
function Pending(message) { | ||
this.message = message; | ||
} |
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 |
---|---|---|
@@ -1,3 +1,41 @@ | ||
describe('pending', function(){ | ||
it('should be allowed') | ||
}) | ||
|
||
describe('skip in test', function(){ | ||
it('should skip immediately', function(){ | ||
this.skip(); | ||
throw new Error('never thrown'); | ||
}) | ||
|
||
it('should run other tests in the suite', function(){ | ||
}) | ||
}) | ||
|
||
describe('skip in before', function(){ | ||
before(function(){ | ||
this.skip(); | ||
}) | ||
|
||
it('should never run this test', function(){ | ||
throw new Error('never thrown'); | ||
}) | ||
|
||
it('should never run this test', function(){ | ||
throw new Error('never thrown'); | ||
}) | ||
}) | ||
|
||
describe('skip in beforeEach', function(){ | ||
beforeEach(function(){ | ||
this.skip(); | ||
}) | ||
|
||
it('should never run this test', function(){ | ||
throw new Error('never thrown'); | ||
}) | ||
|
||
it('should never run this test', function(){ | ||
throw new Error('never thrown'); | ||
}) | ||
}) |