Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(jest): skip auto-cleanup tests in Jest #417

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

mcous
Copy link
Collaborator

@mcous mcous commented Dec 8, 2024

The update to esm-env@2 from sveltejs/svelte#14460 caused our auto-cleanup tests in Jest to start failing on Svelte's internal runes environment check heuristic.

FAIL  src/__tests__/auto-cleanup.test.js
 ● auto-cleanup › calls afterEach with cleanup if globally defined

   Svelte error: rune_outside_svelte
   The `$state` rune is only available inside `.svelte` and `.svelte.js/ts` files

I'm not entirely sure of the failure mechanism, but there's a definite difference in what esm-env reports in Jest+JSDOM in v1 vs v2. That being said, the auto-cleanup tests use mock functions, reseting the module cache, and faking out process.env. On top of that, Jest's ESM support is still experimental. There's a high chance there are shenanigans that have nothing to do with esm-env and/or svelte.

I'll revisit this test when I'm ready to split the different test runners out into their own E2E-style tests with separate install environments, which (hopefully) will remove the need for the fakery and import cache resetting. For now, skipping to get CI back to green. Auto-cleanup tests continue to pass in Vitest

@mcous mcous merged commit 7f86754 into main Dec 8, 2024
31 checks passed
@mcous mcous deleted the ci/skip-autocleanup-tests-in-jest branch December 8, 2024 18:12
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.

1 participant