Skip to content

Commit

Permalink
feat: report status of the spec closes #129
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimr committed Aug 19, 2016
1 parent 9c7d446 commit 5b224e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
24 changes: 24 additions & 0 deletions test/adapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b224e2

Please sign in to comment.