-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: expanded assertions for console.timeEnd() output #17368
Conversation
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 nodejs#14544 but will not address the whole thing. Refs: nodejs#14643
Landed in 5282f96 Thanks for the PR! 🎉 ✨ |
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>
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>
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>
Should this be backported to Test fails on v8.x with: === release test-console ===
Path: parallel/test-console
label: 0.032ms
foo
foo bar
foo bar hop
{ slashes: '\\\\' }
inspect
foo
foo bar
foo bar hop
{ slashes: '\\\\' }
inspect
{ foo: 'bar', inspect: [Function: inspect] }
{ foo: 'bar', inspect: [Function: inspect] }
{ foo: [Object] }
{ foo: { bar: [Object] } }
label: 0.008ms
__proto__: 0.004ms
constructor: 0.004ms
hasOwnProperty: 0.004ms
label1: 0.014ms
label2: 0.091ms
label3: 0.130ms
foo
foo bar
foo bar hop
{ slashes: '\\\\' }
inspect
foo
foo bar
foo bar hop
{ slashes: '\\\\' }
inspect
Trace: This is a {"formatted":"trace"} 10 foo
at Object.<anonymous> (/build/gib/node/test/parallel/test-console.js:92:9)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
/build/gib/node/test/parallel/test-console.js:147
assert.ok(/^: \d+\.\d{3}ms$/.test(strings.shift().trim()));
^
TypeError: Cannot read property 'trim' of undefined
at Object.<anonymous> (/build/gib/node/test/parallel/test-console.js:147:50)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Command: out/Release/node /build/gib/node/test/parallel/test-console.js |
@gibfahn, not sure if I understand correctly. Is the underlying PR #14643 a part of v8.x already? If not, the tests that I have added in this PR to cover the changes will fail. I have read through the backporting guide. If I got that right, in case it is decided to go ahead with the backport, then I am supposed to initiate the backport PR according to the defined process, correct? |
Ahh, my mistake, so this tests functionality added in #14643, which is
Yes, that would be correct if this did need a backport (which as you point out it doesn't). Thanks for clarifying! |
Added assertions to verify that
console.time()
coerces labels tostrings correctly, by comparing against the expected output values of
console.timeEnd()
.Contributes towards #14544.
Refs: #14643
Checklist
make -j4 test
(UNIX) passesAffected core subsystem(s)
test, console