-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Missing error fields when running in jest (26) #422
Comments
Hi @Tallyb, this looks like a bug from Jest, I think this should be reported to them instead? |
@ehmicky |
From the answer on the Jest issue, it appears that this is because Execa is using |
Unfortunately, you cannot rely on We can do this check instead: Object.prototype.toString.call(new Error()) === '[object Error]' |
Oh I did not know that. So you mean: if a I noted that the code you posted is what core Node.js seems to do too. Unfortunately, > Object.prototype.toString.call({ [Symbol.toStringTag]: 'Error' })
'[object Error]'
> util.types.isNativeError({ [Symbol.toStringTag]: 'Error' })
false Looks like there should be some tiny |
PR at #423. |
Thanks for this! Learning something new every day! |
Running execa 4.0.0 with the following code results as follow:
When running in jest the following code (execa@4 or execa@3):
code and exitCode are missing.
Running the above test with execs@2.0.0 results the following:
I am aware that there are breaking changes between 2 and 3 related to the code, but I am wondering if the exitCode (and code and errno) should remain or not.
Not sure if this is stripped by Jest, but jest is on the same version for both).
The text was updated successfully, but these errors were encountered: