Skip to content

Commit

Permalink
Add setup step to configure ResizeObserver
Browse files Browse the repository at this point in the history
  • Loading branch information
dottorblaster committed Aug 18, 2023
1 parent b7f9b11 commit ba2f682
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = {
// runner: "jest-runner",

// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
setupFiles: ['./setupTests.js'],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
Expand Down
5 changes: 5 additions & 0 deletions assets/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
}));

0 comments on commit ba2f682

Please sign in to comment.