diff --git a/CHANGELOG.md b/CHANGELOG.md index 35c9e3cd40ae..e7ff5c291841 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - `[jest-config]` Add missing options to the `defaults` object ([#6428](https://github.com/facebook/jest/pull/6428)) - `[expect]` Using symbolic property names in arrays no longer causes the `toEqual` matcher to fail ([#6391](https://github.com/facebook/jest/pull/6391)) - `[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)) +- `[jest-util]` `console.timeEnd` now properly log elapsed time in milliseconds. ([#6456](https://github.com/facebook/jest/pull/6456)) - `[jest-mock]` Fix `MockNativeMethods` access in react-native `jest.mock()` ([#6505](https://github.com/facebook/jest/pull/6505)) ### Chore & Maintenance diff --git a/packages/jest-util/src/Console.js b/packages/jest-util/src/Console.js index 2ec73a81e1ed..064d9842fc2c 100644 --- a/packages/jest-util/src/Console.js +++ b/packages/jest-util/src/Console.js @@ -127,7 +127,7 @@ export default class CustomConsole extends Console { if (startTime) { const endTime = new Date(); - const time = (endTime - startTime) / 1000; + const time = endTime - startTime; this._log('time', format(`${label}: ${time}ms`)); delete this._timers[label]; } diff --git a/packages/jest-util/src/buffered_console.js b/packages/jest-util/src/buffered_console.js index 5cee80665474..434d8d194927 100644 --- a/packages/jest-util/src/buffered_console.js +++ b/packages/jest-util/src/buffered_console.js @@ -151,7 +151,7 @@ export default class BufferedConsole extends Console { if (startTime) { const endTime = new Date(); - const time = (endTime - startTime) / 1000; + const time = endTime - startTime; this._log('time', format(`${label}: ${time}ms`)); delete this._timers[label]; }