Skip to content

Commit

Permalink
Merge pull request #132 from maksimr/master
Browse files Browse the repository at this point in the history
feat: report status of the spec closes #129
  • Loading branch information
maksimr committed Aug 19, 2016
2 parents 5bb60bf + 5b224e2 commit 7578f91
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
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
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 7578f91

Please sign in to comment.