karma-spec-json-reporter
Advanced tools
Comparing version 0.0.1 to 0.0.7
11
index.js
@@ -11,9 +11,8 @@ /*global require,console,process,module*/ | ||
var current = output, | ||
i; | ||
for (i = 0; i < suite.length; i += 1) { | ||
if (current[suite[i]] === undefined) { | ||
current[suite[i]] = {}; | ||
} | ||
current = current[suite[i]]; | ||
key = suite.join(' '); | ||
if (current[key] === undefined) { | ||
current[key] = {}; | ||
} | ||
current = current[key]; | ||
return current; | ||
@@ -20,0 +19,0 @@ } |
{ | ||
"name": "karma-spec-json-reporter", | ||
"version": "0.0.1", | ||
"version": "0.0.7", | ||
"description": "A Karma JSON reporter for specs", | ||
"main": "index.js", | ||
"scripts": { | ||
@@ -8,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
@@ -30,3 +30,3 @@ describe("Reporter", function() { | ||
it("should nest tests that have multiple suites", function() { | ||
it("should flatten nested tests that have multiple suites", function() { | ||
var input = testObject(); | ||
@@ -36,6 +36,4 @@ input.suite.push("a second suite"); | ||
var expectedOutput = { | ||
"a suite" : { | ||
"a second suite" : { | ||
"a description" : "PASSED" | ||
} | ||
"a suite a second suite" : { | ||
"a description" : "PASSED" | ||
} | ||
@@ -42,0 +40,0 @@ } |
4505
133