Repository navigation
Test runner: spec reporter hides assert.deepStrictEqual diff when used with --test parameter #47051
Copy link
Copy link
Closed
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Activity
Duplicate of: #46871
fixed by c7e6a0c
- addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Mar 12, 2023 @MoLow I don't think that's fixed (quick assumption, can't download nightly right now): this issue related only to spec reporter, not tap.
As you can see, there are no issue with expected / actual values before that fix, only error name was missed:

Also,
node --test-reporter tap --test t.jsproduces valid output, so there is a specific issue of spec reporter:# Subtest: deepEqual not ok 1 - deepEqual --- duration_ms: 6.299085 failureType: 'testCodeFailure' error: |- Expected values to be strictly deep-equal: + actual - expected { + a: 1 - b: 2 } code: 'ERR_ASSERTION' operator: 'deepStrictEqual'I confirmed again, both worked on the main branch:
./node --test-reporter spec a.mjs 1 ✘ ✖ deepEqual (1.964041ms) AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: + actual - expected { + a: 1 - b: 2 } at TestContext.<anonymous> (file:///Users/moshe/repos/node/a.mjs:5:3) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:547:25) at Test.start (node:internal/test_runner/test:463:17) at startSubtest (node:internal/test_runner/harness:192:17) at async file:///Users/moshe/repos/node/a.mjs:4:1 { generatedMessage: true, code: 'ERR_ASSERTION', actual: [Object], expected: [Object], operator: 'deepStrictEqual' } ℹ tests 1 ℹ pass 0 ℹ fail 1 ℹ cancelled 0 ℹ skipped 0 ℹ todo 0 ℹ duration_ms 5.899916./node --test --test-reporter spec a.mjs 9 ✘ ✖ deepEqual (2.09675ms) AssertionError: Expected values to be strictly deep-equal: + actual - expected { + a: 1 - b: 2 } at TestContext.<anonymous> (file:///Users/moshe/repos/node/a.mjs:5:3) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:547:25) at Test.start (node:internal/test_runner/test:463:17) at startSubtest (node:internal/test_runner/harness:192:17) at async file:///Users/moshe/repos/node/a.mjs:4:1 { generatedMessage: false, code: 'ERR_ASSERTION', actual: undefined, expected: undefined, operator: 'deepStrictEqual' } ℹ tests 1 ℹ pass 0 ℹ fail 1 ℹ cancelled 0 ℹ skipped 0 ℹ todo 0 ℹ duration_ms 91.159458Reacted by Vladimir Grenaderov and Moshe Atlow@MoLow thank you!
Metadata
Metadata
Assignees
Labels
test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Version
v19.7.0
Platform
Darwin MOW-C02CF81MMD6T 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64
Subsystem
No response
What steps will reproduce the bug?
With given file t.js
node --test-reporter spec t.js-> diff is present (see expected behaviour)node --test-reporter spec --test t.js-> no diff at allHow often does it reproduce? Is there a required condition?
100%
What is the expected behavior?
Output with diff like that
What do you see instead?
No diff, actual & expected values are undefined
Additional information
This make makes spec reporter are totally useless, because I have to re-run failed tests one by one to understand what's happened.