Revert "Revert "Added the ability to associate trace information with failing specs""

This reverts commit fdad8849df.
This commit is contained in:
Steve Gravrock
2021-10-02 09:56:25 -07:00
parent 9c03d4d3e9
commit 47081258cd
12 changed files with 447 additions and 7 deletions

View File

@@ -1148,6 +1148,16 @@ getJasmineRequireObj().Env = function(j$) {
currentSuite().setSuiteProperty(key, value);
};
this.trace = function(msg) {
var maybeSpec = currentRunnable();
if (!maybeSpec || !maybeSpec.trace) {
throw new Error("'trace' was called when there was no current spec");
}
maybeSpec.trace(msg);
};
this.expect = function(actual) {
if (!currentRunnable()) {
throw new Error(