Skip to content

Commit

Permalink
Merge pull request #113 from gemini-testing/fix/skip-only
Browse files Browse the repository at this point in the history
Method skip.only should skip only one test/suite below the record
  • Loading branch information
DudaGod authored Feb 7, 2017
2 parents 3dbeba1 + c13adc8 commit 7382653
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 7382653

Please sign in to comment.