Skip to content

Commit

Permalink
test: add failing tests from PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
macklinu committed Mar 9, 2018
1 parent 091d787 commit d096af7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rules/__tests__/valid-expect.test.js
Expand Up @@ -173,5 +173,19 @@ ruleTester.run('valid-expect', rule, {
{ message: "Cannot use 'rejects' with an awaited expect expression" },
],
},
{
code:
'test("foo", async () => { expect(await Promise.resolve(undefined)).resolves.not.toBeDefined(); });',
errors: [
{ message: "Cannot use 'resolves' with an awaited expect expression" },
],
},
{
code:
'test("foo", async () => { expect(await Promise.reject(undefined)).rejects.not.toBeDefined(); });',
errors: [
{ message: "Cannot use 'rejects' with an awaited expect expression" },
],
},
],
});

0 comments on commit d096af7

Please sign in to comment.