diff --git a/src/vitest.js b/src/vitest.js index daa1460..6fc9c32 100644 --- a/src/vitest.js +++ b/src/vitest.js @@ -7,6 +7,9 @@ export default function (options = {}) { name: '@hapi/oxc-plugin:vitest', async configureVitest({ injectTestProjects }) { await injectTestProjects({ + // Vitest 5 makes inline projects extend the declaring config by default, which + // would run the host's own tests a 2nd time under this project. + extends: false, define: { __HAPI_OXC_OXLINT__: oxlint, __HAPI_OXC_OXFMT__: oxfmt, diff --git a/test/vitest.js b/test/vitest.js index 4d621cf..f0a2b47 100644 --- a/test/vitest.js +++ b/test/vitest.js @@ -32,6 +32,7 @@ describe('vitest plugin', () => { const injected = await internals.inject(plugin); expect(injected).toHaveLength(1); + expect(injected[0].extends).toBe(false); expect(injected[0].test.name).toBe('@hapi/oxc-plugin'); expect(injected[0].test.include).toHaveLength(1); expect(injected[0].test.include[0]).toMatch(/vitest\.test\.js$/);