Skip to content

Commit

Permalink
fix: skip.only should skip only one test/suite below the record
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Feb 7, 2017
1 parent 3dbeba1 commit c13adc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/runner/mocha-runner/skip/index.js
Expand Up @@ -15,11 +15,10 @@ module.exports = class Skip {

if (this.silent) {
this._rmFromTree(entity);
return;
} else {
_.extend(entity, {pending: true, skipReason: this.comment});
}

_.extend(entity, {pending: true, skipReason: this.comment});

this._resetInfo();
}

Expand Down
14 changes: 13 additions & 1 deletion test/lib/runner/mocha-runner/skip/index.js
Expand Up @@ -60,7 +60,7 @@ describe('Skip', () => {
assert.notProperty(test, 'skipReason');
});

it('should reset skip data after test will be skipped', () => {
it('should reset skip data after test will be skipped loudly', () => {
const test = mkTest();
skip.shouldSkip = true;
skip.silent = false;
Expand All @@ -72,6 +72,18 @@ describe('Skip', () => {
assert.equal(skip.silent, false);
});

it('should reset skip data after test will be skipped silently', () => {
const test = mkTest();
skip.shouldSkip = true;
skip.silent = true;

skip.handleEntity(test);

assert.equal(skip.comment, '');
assert.equal(skip.shouldSkip, false);
assert.equal(skip.silent, false);
});

describe('silent flag', () => {
it('should remove silently skipped test from the end of parent tests', () => {
const test = _.set({type: 'test'}, 'parent.tests', ['test1', 'test2']);
Expand Down

0 comments on commit c13adc8

Please sign in to comment.