Skip to content

Warn Developers Lacking a Global afterEach Function Instead of Throwing Errors #309

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

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style: Combine Tests Related to Test Running Env
  • Loading branch information
ITenthusiasm committed Nov 17, 2023
commit 4025d2a34ef760c244cb49edfa73647d1ad8f5ed
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
beforeEach(jest.restoreAllMocks)

test('Testing Utilities with global access to `afterEach()` will not log warnings', () => {
jest.spyOn(console, 'warn')
global.afterEach = () => {}

require('..')
expect(console.warn).not.toHaveBeenCalled()
})

test('Testing Utilities lacking a global `afterEach` function will log a warning ONCE', () => {
delete global.afterEach
const warn = jest.spyOn(console, 'warn')
Expand Down
7 changes: 0 additions & 7 deletions src/__tests__/auto-cleanup-vitest-globals.js

This file was deleted.