Skip to content

Commit

Permalink
test(jest): skip auto-cleanup tests in Jest
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous committed Dec 8, 2024
1 parent f234661 commit b6cb30b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/__tests__/auto-cleanup.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'

const globalAfterEach = vi.fn()
import { IS_JEST } from './utils.js'

// TODO(mcous, 2024-12-08): clearing module cache and re-importing
// in Jest breaks Svelte's environment checking heuristics.
// Re-implement this test in a more accurate environment, without mocks.
describe.skipIf(IS_JEST)('auto-cleanup', () => {
const globalAfterEach = vi.fn()

describe('auto-cleanup', () => {
beforeEach(() => {
vi.resetModules()
globalThis.afterEach = globalAfterEach
Expand Down

0 comments on commit b6cb30b

Please sign in to comment.