Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-util/src/Console.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default class CustomConsole extends Console {

if (startTime) {
const endTime = new Date();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be using process.hrtime, not Date. Not related to this PR, though...

const time = (endTime - startTime) / 1000;
const time = endTime - startTime;
this._log('time', format(`${label}: ${time}ms`));
delete this._timers[label];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-util/src/buffered_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down