Open marr opened 2 years ago
@marr sorry for the late reply. Your repo helped us identify another bug (thanks), and we were able to address that, however not related to your actual issue.
Now that is out of the way, I played with your sample repo again today: the original repo (after uncommented the xdescribe
), showed ERR_UNHANDLED_REJECTION
:
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: expect(received).resolves.toContain(expected) // indexOf
Expected value: 2
Received array: [1]".] {
code: 'ERR_UNHANDLED_REJECTION'
}
So I modified your tests then all is well:
The green check mark you saw in the TestExplorer is a cached status since the async error interfered with the proper update. It should do better, fortunately, this is addressed in the next release:
Thanks for bringing this to our attention, hopefully after fixing your test code you are good to go.
Environment
vscode-jest version
: 4.6.0node -v
: 16.16.0npm -v
oryarn --version
: npm 8.11.0npm ls jest
ornpm ls react-scripts
(if you haven’t ejected): jest@28.1.3Prerequisite
Steps to Reproduce
https://github.com/marr/jest-async-fail
npm install
npx jest
Relevant Debug Info
This is blocking us from fully adopting/trusting the plugin at the moment. Some screenshots are included to potentially point out that within the jest runner for this test,
asyncError
is set to an Error object, but as you can see below things are green in the ide.Thanks for any help