Skip to content

Commit

Permalink
Use milliseconds in console.timeEnd (#6456)
Browse files Browse the repository at this point in the history
* Use milliseconds in console.timeEnd

* Update CHANGELOG
  • Loading branch information
HiDeoo authored and cpojer committed Jun 20, 2018
1 parent fcadc46 commit 87bf0dd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
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();
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

0 comments on commit 87bf0dd

Please # to comment.