Attempting to follow this documentation:
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:
jestEnvironment (most likely of little relevance here):
yarn 1.3.2
node v8.5.0
windows 7
This will be fixed in Jest 22. You can try jest@test to get the latest beta where this issue was fixed (correct me if I'm wrong @SimenB).
Correct, see #4884, #4945 etc

Most helpful comment
Correct, see #4884, #4945 etc