Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/adapters/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ function TesteeReporter(runner) {
} else if(data.title === '"before all" hook') {
// tests in this suite will never run if before() fails,
// so create the first test in order to fail it.
data = data.parent.tests[0];
var test;
data.parent.eachTest(function(t) {
test = test || t;
})
data = test || data;
diff = self.diff(data);
self.api['test'](diff);
} else {
// after all hook. apply to last test, which has already ran
data = data.parent.tests[data.parent.tests.length - 1];
data.parent.eachTest(function(t) {
data = t;
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function compare (assert, reference, actual, name) {
} else if(key === 'duration') {
assert.ok(inRange(expected, current, 20), name + ' ' + key + ' === ' + expected + '(+/- 20)');
} else {
assert.equal(expected, current, name + ' ' + key + ' === ' + expected);
assert.equal(current, expected, name + ' ' + key + ' === ' + expected);
}
}
}
Expand Down