diff --git a/lib/runner/mocha-runner/skip/index.js b/lib/runner/mocha-runner/skip/index.js index b8c068cc0..931402cc2 100644 --- a/lib/runner/mocha-runner/skip/index.js +++ b/lib/runner/mocha-runner/skip/index.js @@ -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(); } diff --git a/test/lib/runner/mocha-runner/skip/index.js b/test/lib/runner/mocha-runner/skip/index.js index 7a18b3a2d..9ff9f8ed6 100644 --- a/test/lib/runner/mocha-runner/skip/index.js +++ b/test/lib/runner/mocha-runner/skip/index.js @@ -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; @@ -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']);