Skip to content

Commit

Permalink
test(jest): skip auto-cleanup tests in Jest (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous authored Dec 8, 2024
1 parent f234661 commit 7f86754
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 7f86754

Please sign in to comment.