diff options
Diffstat (limited to 'tests/lib/mocha-3.1.2/test/integration/suite.spec.js')
-rw-r--r-- | tests/lib/mocha-3.1.2/test/integration/suite.spec.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.2/test/integration/suite.spec.js b/tests/lib/mocha-3.1.2/test/integration/suite.spec.js new file mode 100644 index 0000000000..171a929ed1 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/suite.spec.js @@ -0,0 +1,43 @@ +'use strict'; + +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); + var 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); + var pattern = new RegExp('Error', 'g'); + var result = res.output.match(pattern) || []; + assert.equal(result.length, 0); + done(); + }); + }); +}); |