forked from mochajs/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow skip() in async test context; closes mochajs#2334
- Loading branch information
Showing
5 changed files
with
91 additions
and
0 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 @@ | ||
describe('skip in before', function() { | ||
before(function(done) { | ||
var self = this; | ||
setTimeout(function() { | ||
self.skip(); | ||
}, 50); | ||
}); | ||
|
||
it('should never run this test', function() { | ||
throw new Error('never thrown'); | ||
}); | ||
|
||
it('should never run this test', function() { | ||
throw new Error('never thrown'); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
test/integration/fixtures/pending/skip.async.beforeEach.js
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 @@ | ||
describe('skip in beforeEach', function() { | ||
beforeEach(function(done) { | ||
var self = this; | ||
setTimeout(function() { | ||
self.skip(); | ||
}, 50); | ||
}); | ||
|
||
it('should never run this test', function() { | ||
throw new Error('never thrown'); | ||
}); | ||
|
||
it('should never run this test', function() { | ||
throw new Error('never thrown'); | ||
}); | ||
}); |
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,12 @@ | ||
describe('skip in test', function() { | ||
it('should skip async', function(done) { | ||
var self = this; | ||
setTimeout(function() { | ||
self.skip(); | ||
}, 50); | ||
}); | ||
|
||
it('should run other tests in the suite', function() { | ||
// Do nothing | ||
}); | ||
}); |
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