-
-
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.
helpful error when necessary suite callback omitted; closes #1744
- works for QUnit as well - renamed some files - fixed unclear "only" tests
- Loading branch information
Showing
8 changed files
with
81 additions
and
55 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
File renamed without changes.
1 change: 1 addition & 0 deletions
1
test/integration/fixtures/suite/suite-skipped-callback.fixture.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 @@ | ||
xdescribe('a pending suite with a callback', function () {}); |
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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,42 @@ | ||
var assert = require('assert'); | ||
var run = require('./helpers').runMocha; | ||
var args = []; | ||
|
||
describe('suite w/no callback', function() { | ||
this.timeout(1000); | ||
it('should throw a helpful error message when a callback for suite is not supplied', function(done) { | ||
run('suite/suite-no-callback.fixture.js', args, function(err, res) { | ||
assert(!err); | ||
var result = res.output.match(/no callback was supplied/) || []; | ||
assert.equal(result.length, 1); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('skipped suite w/no callback', function() { | ||
this.timeout(1000); | ||
it('should not throw an error when a callback for skipped suite is not supplied', function(done) { | ||
run('suite/suite-skipped-no-callback.fixture.js', args, function(err, res) { | ||
assert(!err); | ||
pattern = new RegExp("Error", 'g'); | ||
var result = res.output.match(pattern) || []; | ||
assert.equal(result.length, 0); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
|
||
describe('skipped suite w/ callback', function() { | ||
this.timeout(1000); | ||
it('should not throw an error when a callback for skipped suite is supplied', function(done) { | ||
run('suite/suite-skipped-callback.fixture.js', args, function(err, res) { | ||
assert(!err); | ||
pattern = new RegExp("Error", 'g'); | ||
var result = res.output.match(pattern) || []; | ||
assert.equal(result.length, 0); | ||
done(); | ||
}); | ||
}); | ||
}); |