Added the ability to associate trace information with failing specs

This is meant to aid in debugging failures, particularly intermittent
failures, in cases where interactive debugging or console.log aren't
suitable.
This commit is contained in:
Steve Gravrock
2021-09-25 16:07:33 -07:00
parent ef981bb794
commit 7a289f1de7
12 changed files with 447 additions and 7 deletions

View File

@@ -420,4 +420,20 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) {
putativeSpy.calls instanceof j$.CallTracker
);
};
/**
* Logs a message for use in debugging. If the spec fails, trace messages
* will be included in the {@link SpecResult|result} passed to the
* reporter's specDone method.
*
* This method should be called only when a spec (including any associated
* beforeEach or afterEach functions) is running.
* @function
* @name jasmine.trace
* @since 3.10.0
* @param {String} msg - The message to log
*/
j$.trace = function(msg) {
j$.getEnv().trace(msg);
};
};