Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/vitest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions test/vitest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$/);
Expand Down
Loading