From 5b224e26e4e4cc1faa6bfc718afcf090beaf7b30 Mon Sep 17 00:00:00 2001 From: Maksim Ryzhikov Date: Thu, 11 Aug 2016 10:55:04 +0300 Subject: [PATCH] feat: report status of the spec closes #129 --- src/adapter.js | 2 ++ test/adapter.spec.js | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/adapter.js b/src/adapter.js index 0c293e1..04e3181 100644 --- a/src/adapter.js +++ b/src/adapter.js @@ -219,6 +219,8 @@ function KarmaReporter (tc, jasmineEnv) { id: specResult.id, log: [], skipped: skipped, + disabled: specResult.status === 'disabled', + pending: specResult.status === 'pending', success: specResult.failedExpectations.length === 0, suite: [], time: skipped ? 0 : new Date().getTime() - specResult.startTime, diff --git a/test/adapter.spec.js b/test/adapter.spec.js index b0e057f..2f4ad00 100644 --- a/test/adapter.spec.js +++ b/test/adapter.spec.js @@ -95,6 +95,30 @@ describe('jasmine adapter', function () { expect(karma.result).toHaveBeenCalled() }) + it('should report disabled status', function () { + spec.result.status = 'disabled' + + karma.result.and.callFake(function (result) { + expect(result.skipped).toBe(true) + expect(result.disabled).toBe(true) + }) + + reporter.specDone(spec.result) + expect(karma.result).toHaveBeenCalled() + }) + + it('should report pending status', function () { + spec.result.status = 'pending' + + karma.result.and.callFake(function (result) { + expect(result.skipped).toBe(true) + expect(result.pending).toBe(true) + }) + + reporter.specDone(spec.result) + expect(karma.result).toHaveBeenCalled() + }) + it('should report executedExpectCount 0 if no expectations', function () { karma.result.and.callFake(function (result) { expect(result.executedExpectationsCount).toBe(0)