Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect function and its call. #183

Merged
merged 1 commit into from Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/adapter.js
Expand Up @@ -163,14 +163,6 @@ function KarmaReporter (tc, jasmineEnv) {
var _Date = Date
var startTimeCurrentSpec = new _Date().getTime()

/**
* @param suite
* @returns {boolean} Return true if it is system jasmine top level suite
*/
function isTopLevelSuite (suite) {
return suite.description === 'Jasmine_TopLevel_Suite'
}

function handleGlobalErrors (result) {
if (result.failedExpectations && result.failedExpectations.length) {
var message = 'An error was thrown in afterAll'
Expand Down Expand Up @@ -215,9 +207,7 @@ function KarmaReporter (tc, jasmineEnv) {
}

this.suiteStarted = function (result) {
if (!isTopLevelSuite(result)) {
currentSuite = currentSuite.addChild(result.description)
}
currentSuite = currentSuite.addChild(result.description)
}

this.suiteDone = function (result) {
Expand Down
17 changes: 0 additions & 17 deletions test/adapter.spec.js
Expand Up @@ -245,23 +245,6 @@ describe('jasmine adapter', function () {
expect(karma.result).toHaveBeenCalled()
})

it('should remove special top level suite from result', function () {
karma.result.and.callFake(function (result) {
expect(result.suite).toEqual(['Child Suite'])
})

reporter.suiteStarted({
id: 'suite0',
description: 'Jasmine_TopLevel_Suite'
})
reporter.suiteStarted(suite.result)
spec.result.failedExpectations.push({stack: 'stack'})

reporter.specDone(spec.result)

expect(karma.result).toHaveBeenCalled()
})

it('should report time for every spec', function () {
var counter = 3

Expand Down