When I start a simple jest test:
describe('console test', () => {
it('console.logTime test', () => {
// nocommit: https://stackoverflow.com/questions/58961221/console-timelog-not-working-in-nodejs-12
console.log(process.version);
console.time('process');
for (let i = 0; i < 100000; i++) {}
console.timeLog('process', 42);
for (let i = 0; i < 100000; i++) {}
console.timeEnd('process');
});
});
I can see a warning that timeLog does not recognize the process label:
console.log src/lib/rxjs/rxjs-util.spec.ts:67
v12.12.0
console.time src/lib/rxjs/rxjs-util.spec.ts:73
process: 2ms
(node:17748) Warning: No such label 'process' for console.timeLog()
The example is almost the same as in the docs for timeLog().
Notes:
24.9.0What am I missing here?
As of jest v26.2.0 console.timeLog() is supported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With