Skip to content

fix: eliminate Vite config loader warning in tests - #1068

Merged
EhabY merged 1 commit into
mainfrom
fix/test-warnings
Aug 10, 2026
Merged

fix: eliminate Vite config loader warning in tests#1068
EhabY merged 1 commit into
mainfrom
fix/test-warnings

Conversation

@EhabY

@EhabY EhabY commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

What

pnpm test printed a Vite config loader warning (3x): vitest.config.ts uses ESM syntax but the root package.json has "type": "commonjs", so Vite loads it as CJS and warns about the upcoming configLoader: "native" default.

Changes

  • Rename vitest.config.tsvitest.config.mts and replace __dirname with import.meta.dirname. This makes the config unambiguously ESM, silencing the warning.

Note: this PR originally also fixed React act() warnings in useVscodeTheme.test.ts. That fix landed on main via #1047, so it dropped out of this diff on rebase.

Verification

  • All 153 test files / 2367 tests pass with zero warnings in the output.
  • pnpm typecheck, pnpm lint, and pnpm format:check pass.

Generated by Coder Agents

@EhabY
EhabY force-pushed the fix/test-warnings branch from 0c982ba to 47b3b48 Compare August 6, 2026 00:16
@EhabY EhabY self-assigned this Aug 6, 2026
@EhabY
EhabY force-pushed the fix/test-warnings branch from 47b3b48 to 45c1dbe Compare August 10, 2026 13:12
@EhabY
EhabY requested a review from DanielleMaywood August 10, 2026 13:20

@DanielleMaywood DanielleMaywood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks fine although doesn't match PR description and title. There are no changes with regard to React act warnings

@EhabY

EhabY commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

There are no changes with regard to React act warnings

Oh I rebased and the rebase contained this fix already so it's no longer valid lol

Rename vitest.config.ts to .mts and replace __dirname with
import.meta.dirname so Vite loads the config as ESM, resolving the
native configLoader deprecation warning. The React act() warnings
originally addressed alongside this were fixed on main in #1047.
@EhabY EhabY changed the title fix: eliminate Vite config and React act() warnings in tests fix: eliminate Vite config loader warning in tests Aug 10, 2026
@EhabY
EhabY force-pushed the fix/test-warnings branch from 45c1dbe to e53cde7 Compare August 10, 2026 16:50
@EhabY
EhabY merged commit 59124cc into main Aug 10, 2026
11 checks passed
@EhabY
EhabY deleted the fix/test-warnings branch August 10, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants