@jest/console
Advanced tools
Comparing version 26.1.0 to 26.2.0
@@ -31,4 +31,5 @@ /** | ||
timeEnd(label?: string): void; | ||
timeLog(label?: string, ...data: Array<unknown>): void; | ||
warn(firstArg: unknown, ...rest: Array<unknown>): void; | ||
getBuffer(): ConsoleBuffer | undefined; | ||
} |
@@ -228,2 +228,19 @@ 'use strict'; | ||
timeLog(label = 'default', ...data) { | ||
const startTime = this._timers[label]; | ||
if (startTime) { | ||
const endTime = new Date(); | ||
const time = endTime.getTime() - startTime.getTime(); | ||
this._log( | ||
'time', | ||
(0, _util().format)( | ||
`${label}: ${(0, _jestUtil().formatTime)(time)}`, | ||
...data | ||
) | ||
); | ||
} | ||
} | ||
warn(firstArg, ...rest) { | ||
@@ -230,0 +247,0 @@ this._log('warn', (0, _util().format)(firstArg, ...rest)); |
@@ -35,2 +35,3 @@ /** | ||
timeEnd(label?: string): void; | ||
timeLog(label?: string, ...data: Array<unknown>): void; | ||
warn(firstArg: unknown, ...args: Array<unknown>): void; | ||
@@ -37,0 +38,0 @@ getBuffer(): undefined; |
@@ -213,2 +213,19 @@ 'use strict'; | ||
timeLog(label = 'default', ...data) { | ||
const startTime = this._timers[label]; | ||
if (startTime) { | ||
const endTime = new Date(); | ||
const time = endTime.getTime() - startTime.getTime(); | ||
this._log( | ||
'time', | ||
(0, _util().format)( | ||
`${label}: ${(0, _jestUtil().formatTime)(time)}`, | ||
...data | ||
) | ||
); | ||
} | ||
} | ||
warn(firstArg, ...args) { | ||
@@ -215,0 +232,0 @@ this._logError('warn', (0, _util().format)(firstArg, ...args)); |
@@ -17,2 +17,3 @@ /** | ||
timeEnd(): void; | ||
timeLog(): void; | ||
trace(): void; | ||
@@ -19,0 +20,0 @@ warn(): void; |
@@ -37,2 +37,4 @@ 'use strict'; | ||
timeLog() {} | ||
trace() {} | ||
@@ -39,0 +41,0 @@ |
{ | ||
"name": "@jest/console", | ||
"version": "26.1.0", | ||
"version": "26.2.0", | ||
"repository": { | ||
@@ -13,6 +13,7 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/types": "^26.1.0", | ||
"@jest/types": "^26.2.0", | ||
"@types/node": "*", | ||
"chalk": "^4.0.0", | ||
"jest-message-util": "^26.1.0", | ||
"jest-util": "^26.1.0", | ||
"jest-message-util": "^26.2.0", | ||
"jest-util": "^26.2.0", | ||
"slash": "^3.0.0" | ||
@@ -29,3 +30,3 @@ }, | ||
}, | ||
"gitHead": "817d8b6aca845dd4fcfd7f8316293e69f3a116c5" | ||
"gitHead": "4a716811a309dae135b780a87dc1647b285800eb" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21357
694
6
+ Added@types/node@*
Updated@jest/types@^26.2.0
Updatedjest-message-util@^26.2.0
Updatedjest-util@^26.2.0