diff --git a/packages/jsts/src/rules/S2699/assertion.fixture.js b/packages/jsts/src/rules/S2699/assertion.fixture.js new file mode 100644 index 00000000000..ae285d1ad75 --- /dev/null +++ b/packages/jsts/src/rules/S2699/assertion.fixture.js @@ -0,0 +1,19 @@ +const vitest = require('vitest'); + +describe('global expect', () => { // Compliant + it('is recognized as an assertion', () => { + expect(5).toEqual(5); + }); +}); + +describe('global non-supported symbol', () => { // Compliant + it('is not recognized as an assertion', () => { // Noncompliant + foo(5).toEqual(5); + }); +}); + +describe.concurrent('expect called inside describe.concurrent scope', () => { // Compliant + it('is recognized as an assertion', async ({ expect }) => { + expect(5).toEqual(5); + }); +}); diff --git a/packages/jsts/src/rules/S2699/vitest.fixture.js b/packages/jsts/src/rules/S2699/vitest.fixture.js index 143aa717f8e..209991d5310 100644 --- a/packages/jsts/src/rules/S2699/vitest.fixture.js +++ b/packages/jsts/src/rules/S2699/vitest.fixture.js @@ -19,17 +19,7 @@ describe('vitest test cases', () => { check(); }); - it('recognizes global expect as an assertion', () => { - expect(5).toEqual(5); - }); - function check() { expect(1).toEqual(2); } }); - -describe.concurrent('vitest concurrent test cases', () => { - it('recognizes global expect as an assertion', async ({ expect }) => { - expect(5).toEqual(5); - }); -});