-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
π Bug Report
When using console.time & console.timeEnd in a test, the logged elapsed time is indicated as being in milliseconds while actually being in seconds.
To Reproduce
Use console.time & console.timeEnd in a test:
it('should add two numbers', () => {
console.time('test')
expect(add(1, 2)).toBe(3);
console.timeEnd('test')
});Expected behavior
If the elapsed time is 7ms, I expect console.timeEnd to actually logs either:
- test: 7ms
- test: 0.007s
I'm assuming the current behavior is coming from these lines which convert the elapsed time in seconds and then log them in ms.
Link to repl or repo (highly encouraged)
Run npx envinfo --preset jest
System:
OS: macOS High Sierra 10.13.5
CPU: x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Binaries:
Node: 10.3.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npmAdam13531 and Chifilly
Metadata
Metadata
Assignees
Labels
No labels