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
Alternatively, you can use async/await in combination with .rejects.
test('rejects to octopus', async () => {
await expect(Promise.reject(new Error('octopus'))).rejects.toThrow('octopus');
});
I get the error:
$ jest
FAIL .\index.test.js
× async error handling from docs (5ms)
● async error handling from docs
expect(function).toThrow(string)
Received value must be a function, but instead "object" was found
Steps to reproduce:
mkdir test
yarn add jest
touch index.test.js
paste above example from documentation
run jest
Environment (most likely of little relevance here):
yarn 1.3.2
node v8.5.0
windows 7
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Attempting to follow this documentation:
I get the error:
Steps to reproduce:
jest
Environment (most likely of little relevance here):
yarn 1.3.2
node v8.5.0
windows 7
The text was updated successfully, but these errors were encountered: