You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux F3OAllGAMELAP 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
test_runner
What steps will reproduce the bug?
import{describe,it}from'node:test'import{expect}from'chai'describe('Group',()=>{it('should show diff if fails',()=>{try{expect({number: {type: Number}}).to.deep.equal({number: {type: Number,required: true}})}catch(e){console.log('Actual Error',e)// AssertionError from chai has `actual`, `expected` and `showDiff` propertiesthrowe// but in test reporter, these properties are missing}})it('shows diff if fails',()=>{expect({number: {type: 1}}).to.deep.equal({number: {type: 2,required: true}})// works fine, when no function type is present})})
Run this code with node --test, seems like running it with just node fixes the issue.
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
AssertionError properties like (actual, expected) are preserved.
What do you see instead?
AssertionError properties are missing, if some of them have functions inside.
This has nothing to do with chai. The reason you aren't seeing those function values is because a function cannot be sent between processes (which is what happens with --test). If you run with --test --experimental-test-isolation=none, which does not spawn any child processes, you'll see the functions included.
Version
v22.11.0
Platform
Subsystem
test_runner
What steps will reproduce the bug?
Run this code with
node --test
, seems like running it with justnode
fixes the issue.How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
AssertionError properties like (
actual
,expected
) are preserved.What do you see instead?
AssertionError properties are missing, if some of them have functions inside.
Additional information
Repo for reproduction: https://github.com/f3oall/node-test-runner-issue
The text was updated successfully, but these errors were encountered: