diff --git a/src/adapter.js b/src/adapter.js index f6e0e80..c1f2811 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -50,6 +50,7 @@ var createMochaReporterConstructor = function (tc, pathname) { // - test end // - pass // - fail + // - pending runner.on('start', function () { tc.info({total: runner.total}) @@ -65,6 +66,10 @@ var createMochaReporterConstructor = function (tc, pathname) { test.$errors = [] }) + runner.on('pending', function (test) { + test.pending = true + }) + runner.on('fail', function (test, error) { if (test.type === 'hook') { test.$errors = [formatError(error)] diff --git a/test/adapter.spec.js b/test/adapter.spec.js index f9b0d21..d185a89 100644 --- a/test/adapter.spec.js +++ b/test/adapter.spec.js @@ -113,6 +113,21 @@ describe('adapter mocha', function () { expect(tc.result.called).to.eq(true) }) + it('should report skipped result', function () { + sandbox.stub(tc, 'result', function (result) { + expect(result.skipped).to.eq(true) + }) + + var mockMochaResult = { + parent: {root: true} + } + + runner.emit('pending', mockMochaResult) + runner.emit('test end', mockMochaResult) + + expect(tc.result.called).to.eq(true) + }) + it('should report time 0 for skipped tests', function () { sandbox.stub(tc, 'result', function (result) { expect(result.skipped).to.eq(true)