Skip to content

Commit 54f2344

Browse files
committed
test: fix jest setup
1 parent 82fc82c commit 54f2344

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

jest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export default {
133133
// setupFiles: [],
134134

135135
// A list of paths to modules that run some code to configure or set up the testing framework before each test
136-
// setupFilesAfterEnv: [],
136+
setupFilesAfterEnv: ['./src/test/jest-setup.js'],
137137

138138
// The number of seconds after which a test is considered as slow and reported as such in the results.
139139
// slowTestThreshold: 5,

src/test/jest-setup.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import React from 'react'
2+
// whatever else you need in here
3+
4+
global.React = React

0 commit comments

Comments
 (0)