diff options
Diffstat (limited to 'tests/lib/mocha-3.1.0/test/integration/suite.spec.js')
-rw-r--r-- | tests/lib/mocha-3.1.0/test/integration/suite.spec.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.0/test/integration/suite.spec.js b/tests/lib/mocha-3.1.0/test/integration/suite.spec.js new file mode 100644 index 0000000000..00066a34f4 --- /dev/null +++ b/tests/lib/mocha-3.1.0/test/integration/suite.spec.js @@ -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(); + }); + }); +}); |