Skip to content

Commit 87bf0dd

Browse files
HiDeoocpojer
authored andcommitted
Use milliseconds in console.timeEnd (jestjs#6456)
* Use milliseconds in console.timeEnd * Update CHANGELOG
1 parent fcadc46 commit 87bf0dd

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- `[jest-config]` Add missing options to the `defaults` object ([#6428](https://github.com/facebook/jest/pull/6428))
1212
- `[expect]` Using symbolic property names in arrays no longer causes the `toEqual` matcher to fail ([#6391](https://github.com/facebook/jest/pull/6391))
1313
- `[expect]` `toEqual` no longer tries to compare non-enumerable symbolic properties, to be consistent with non-symbolic properties. ([#6398](https://github.com/facebook/jest/pull/6398))
14+
- `[jest-util]` `console.timeEnd` now properly log elapsed time in milliseconds. ([#6456](https://github.com/facebook/jest/pull/6456))
1415
- `[jest-mock]` Fix `MockNativeMethods` access in react-native `jest.mock()` ([#6505](https://github.com/facebook/jest/pull/6505))
1516

1617
### Chore & Maintenance

packages/jest-util/src/Console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default class CustomConsole extends Console {
127127

128128
if (startTime) {
129129
const endTime = new Date();
130-
const time = (endTime - startTime) / 1000;
130+
const time = endTime - startTime;
131131
this._log('time', format(`${label}: ${time}ms`));
132132
delete this._timers[label];
133133
}

packages/jest-util/src/buffered_console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export default class BufferedConsole extends Console {
151151

152152
if (startTime) {
153153
const endTime = new Date();
154-
const time = (endTime - startTime) / 1000;
154+
const time = endTime - startTime;
155155
this._log('time', format(`${label}: ${time}ms`));
156156
delete this._timers[label];
157157
}

0 commit comments

Comments
 (0)