Skip to content

Commit

Permalink
Add test for suite marked only
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottFreeCode committed Aug 2, 2017
1 parent 245c9cc commit 6cdfa05
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/integration/fixtures/options/forbid-only/only-suite.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

describe.only('forbid only - suite marked with only', function () {
it('test1', function () {});
});
13 changes: 12 additions & 1 deletion test/integration/options.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ describe('options', function () {
});

describe('--forbid-only', function () {
var onlyErrorMessage = '`.only` forbidden';

before(function () {
args = ['--forbid-only'];
});
Expand All @@ -198,7 +200,16 @@ describe('options', function () {
run('options/forbid-only/only.js', args, function (err, res) {
assert(!err);
assert.equal(res.code, 1);
assert.equal(res.failures[0].err.message, '`.only` forbidden');
assert.equal(res.failures[0].err.message, onlyErrorMessage);
done();
});
});

it('fails if there are tests in suites marked only', function (done) {
run('options/forbid-only/only-suite.js', args, function (err, res) {
assert(!err);
assert.equal(res.code, 1);
assert.equal(res.failures[0].err.message, onlyErrorMessage);
done();
});
});
Expand Down

0 comments on commit 6cdfa05

Please sign in to comment.