Skip to content

Commit

Permalink
adapt test cases to changed forbidOnly logic
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidOtt authored and boneskull committed Jun 2, 2020
1 parent a223e2c commit 566dae6
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions test/integration/options/forbidOnly.spec.js
Expand Up @@ -92,32 +92,37 @@ describe('--forbid-only', function() {
);
});

it('should succeed if suite marked only does not match grep', function(done) {
it('should fail if suite marked only does not match grep', function(done) {
var fixture = path.join('options', 'forbid-only', 'only-suite');
runMochaJSON(fixture, args.concat('--fgrep', 'bumble bees'), function(
err,
res
) {
if (err) {
return done(err);
}
expect(res, 'to have passed');
done();
});
var spawnOpts = {stdio: 'pipe'};
runMocha(
fixture,
args.concat('--fgrep', 'bumble bees'),
function(err, res) {
if (err) {
return done(err);
}
expect(res, 'to have failed with output', new RegExp(onlyErrorMessage));
done();
},
spawnOpts
);
});

it('should succeed if suite marked only does not match inverted grep', function(done) {
it('should fail if suite marked only does not match inverted grep', function(done) {
var fixture = path.join('options', 'forbid-only', 'only-suite');
runMochaJSON(
var spawnOpts = {stdio: 'pipe'};
runMocha(
fixture,
args.concat('--fgrep', 'suite marked with only', '--invert'),
function(err, res) {
if (err) {
return done(err);
}
expect(res, 'to have passed');
expect(res, 'to have failed with output', new RegExp(onlyErrorMessage));
done();
}
},
spawnOpts
);
});

Expand Down

0 comments on commit 566dae6

Please sign in to comment.