Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee1c95f

Browse filesBrowse files
niveditnMylesBorins
authored andcommitted
test: expanded assertions for console.timeEnd() output
Added assertions to verify that console.time() coerces labels to strings correctly, by comparing against the expected output values of console.timeEnd(). This helps resolve #14544 but will not address the whole thing. PR-URL: #17368 Refs: #14643 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
1 parent 7849d53 commit ee1c95f
Copy full SHA for ee1c95f

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-console.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-console.js
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ assert.ok(/^__proto__: \d+\.\d{3}ms$/.test(strings.shift().trim()));
176176
assert.ok(/^constructor: \d+\.\d{3}ms$/.test(strings.shift().trim()));
177177
assert.ok(/^hasOwnProperty: \d+\.\d{3}ms$/.test(strings.shift().trim()));
178178

179+
// verify that console.time() coerces label values to strings as expected
180+
assert.ok(/^: \d+\.\d{3}ms$/.test(strings.shift().trim()));
181+
assert.ok(/^\[object Object\]: \d+\.\d{3}ms$/.test(strings.shift().trim()));
182+
assert.ok(/^null: \d+\.\d{3}ms$/.test(strings.shift().trim()));
183+
assert.ok(/^default: \d+\.\d{3}ms$/.test(strings.shift().trim()));
184+
assert.ok(/^default: \d+\.\d{3}ms$/.test(strings.shift().trim()));
185+
assert.ok(/^NaN: \d+\.\d{3}ms$/.test(strings.shift().trim()));
186+
179187
assert.strictEqual(errStrings.shift().split('\n').shift(),
180188
'Trace: This is a {"formatted":"trace"} 10 foo');
181189

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.