Create jest setup file for globally used jQuery in tests

This commit is contained in:
Claudio Zizza
2023-10-25 00:25:30 +02:00
committed by Claudio Zizza
parent a2e43ed482
commit f425366257
2 changed files with 3 additions and 0 deletions

View File

@@ -6,5 +6,6 @@ module.exports = {
"transform": {
"^.+\\.js$": "babel-jest",
},
"setupFiles": ["./jest/setup/jest.js"],
testEnvironment: 'jsdom'
};

2
jest/setup/jest.js Normal file
View File

@@ -0,0 +1,2 @@
import $ from 'jquery';
global.$ = global.jQuery = $;