fix: test problems jest dom and paragon (#311)

This commit is contained in:
Jhon Vente
2024-02-02 12:13:12 -05:00
committed by GitHub
parent a9771fbf49
commit 44d6dc616c
3 changed files with 6 additions and 1 deletions

View File

@@ -18,4 +18,8 @@ module.exports = createConfig('jest', {
],
testTimeout: 120000,
testEnvironment: 'jsdom',
moduleNameMapper: {
'^@openedx/paragon$': '<rootDir>/mockParagon.js',
'^@openedx/paragon/(.*)$': '<rootDir>/mockParagon.js',
},
});

1
mockParagon.js Normal file
View File

@@ -0,0 +1 @@
module.exports = {};

View File

@@ -1,6 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/extend-expect';
// breaking change here: https://github.com/testing-library/jest-dom/releases/tag/v6.0.0
import Enzyme from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';