We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Actual behavior When i try to execute the following tests,
test('should throw error (sinon stub)', async t => { const error = new Error('a'); const stub = require('sinon').stub(); stub.throws(error); const afunc = async () => { return stub(); }; t.throwsAsync(await afunc()); }); async function error(){ throw new Error('a'); } test('should throw error', async t => { const afunc = async () => { return await error(); }; t.throwsAsync(await afunc()) });
i get the error
Rejected promise returned by test. Reason: Error { message: 'a', }
Expected behavior The tests should pass.
Environment
The text was updated successfully, but these errors were encountered:
t.throwsAsync(await afunc());
You're awaiting afunc() before throwsAsync() is called.
afunc()
throwsAsync()
Change to:
await t.throwsAsync(afunc());
Sorry, something went wrong.
No branches or pull requests
Actual behavior
When i try to execute the following tests,
i get the error
Rejected promise returned by test. Reason: Error { message: 'a', }
Expected behavior
The tests should pass.
Environment
The text was updated successfully, but these errors were encountered: