diff --git a/rules/__tests__/prefer_expect_assertions.test.js b/rules/__tests__/prefer_expect_assertions.test.js index 417b7cb34..be91c9db1 100644 --- a/rules/__tests__/prefer_expect_assertions.test.js +++ b/rules/__tests__/prefer_expect_assertions.test.js @@ -77,9 +77,7 @@ ruleTester.run('prefer-expect-assertions', rules['prefer-expect-assertions'], { ], valid: [ - { - code: 'test("it1", () => {expect.assertions(0);})', - }, + 'test("it1", () => {expect.assertions(0);})', 'test("it1", function() {expect.assertions(0);})', 'test("it1", function() {expect.hasAssertions();})', 'it("it1", function() {expect.assertions(0);})', @@ -87,5 +85,14 @@ ruleTester.run('prefer-expect-assertions', rules['prefer-expect-assertions'], { '\n\t\t\texpect(someValue).toBe(true)\n' + '\t\t\t})', 'test("it1")', + ` + test('later return', () => { + const promise = something().then(value => { + expect(value).toBe('red'); + }); + + return promise; + }); + `, ], });