Skip to content

Commit

Permalink
adapter.js: Include full name of spec in specDone() (#198)
Browse files Browse the repository at this point in the history
This commit appends the field 'fullName' to the result sent back to the
Karma server. The full name is useful to identify the exact spec that
was run.

API for specResult: https://jasmine.github.io/api/2.9/global.html#SpecResult
  • Loading branch information
kyliau authored and johnjbarton committed Apr 9, 2018
1 parent cada4a9 commit 4f70e5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/adapter.js
Expand Up @@ -232,6 +232,7 @@ function KarmaReporter (tc, jasmineEnv) {
var skipped = specResult.status === 'disabled' || specResult.status === 'pending' || specResult.status === 'excluded'

var result = {
fullName: specResult.fullName,
description: specResult.description,
id: specResult.id,
log: [],
Expand Down
1 change: 1 addition & 0 deletions test/adapter.spec.js
Expand Up @@ -87,6 +87,7 @@ describe('jasmine adapter', function () {
karma.result.and.callFake(function (result) {
expect(result.id).toBe(spec.id)
expect(result.description).toBe('contains spec with an expectation')
expect(result.fullName).toBe('A suite contains spec with an expectation')
expect(result.suite).toEqual(['Parent Suite', 'Child Suite'])
expect(result.success).toBe(true)
expect(result.skipped).toBe(false)
Expand Down

0 comments on commit 4f70e5e

Please sign in to comment.