Skip to content

Commit ee1c95f

Browse files
niknivMylesBorins
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 7849d53 commit ee1c95f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/parallel/test-console.js

+8
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)