Skip to content

Commit

Permalink
Remove incorrect function and its call.
Browse files Browse the repository at this point in the history
The string tested in the function isTopLevelSuite() is not used in jasmine. The
correct string would be Jasmine__TopLevel__Suite (two underscores). So the function
always returns false, and we negate it at the call site, to the child is always
added. That's the correct behavior because we already have a root node matching
the Jasmine top level suite. The test and the function is unnecessary.
  • Loading branch information
johnjbarton committed Jun 13, 2017
1 parent 372adb9 commit 4f1adcc
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/adapter.js
Expand Up @@ -162,14 +162,6 @@ function KarmaReporter (tc, jasmineEnv) {
// because user can mock it
var _Date = Date

/**
* @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 @@ -214,9 +206,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

0 comments on commit 4f1adcc

Please sign in to comment.