Skip to content

Commit 7f86754

Browse files
authored
test(jest): skip auto-cleanup tests in Jest (#417)
1 parent f234661 commit 7f86754

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/__tests__/auto-cleanup.test.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
22

3-
const globalAfterEach = vi.fn()
3+
import { IS_JEST } from './utils.js'
4+
5+
// TODO(mcous, 2024-12-08): clearing module cache and re-importing
6+
// in Jest breaks Svelte's environment checking heuristics.
7+
// Re-implement this test in a more accurate environment, without mocks.
8+
describe.skipIf(IS_JEST)('auto-cleanup', () => {
9+
const globalAfterEach = vi.fn()
410

5-
describe('auto-cleanup', () => {
611
beforeEach(() => {
712
vi.resetModules()
813
globalThis.afterEach = globalAfterEach

0 commit comments

Comments
 (0)