Designed for temporary use when a test using fakeAsync is giving you "Error: X timer(s) still in the queue", and you don't know what they are. Call this at the top of the test to see everything that adds a timer printed to the JS console. In Chrome you can click the function in the console output to be taken directly to its definition in the Sources tab.
Be sure to call this inside the test, not before, to get the most useful output.
Returns (() => void)
a function to stop the logging
it('definitely does not set any timeouts', fakeAsync(() => { conststopLogging = logTimers();
Designed for temporary use when a test using
fakeAsync
is giving you "Error: X timer(s) still in the queue", and you don't know what they are. Call this at the top of the test to see everything that adds a timer printed to the JS console. In Chrome you can click the function in the console output to be taken directly to its definition in the Sources tab.Be sure to call this inside the test, not before, to get the most useful output.