Skip to content

Commit c7b6436

Browse files
committed
Fix jest configuration for dnd-core and test-backend's ES Modules
1 parent 907d2df commit c7b6436

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

jest.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ module.exports = {
1414
],
1515
moduleNameMapper: {
1616
'@angular-skyhook/(.*)': '<rootDir>/packages/$1',
17+
// https://react-dnd.github.io/react-dnd/docs/testing
18+
"^dnd-core$": "dnd-core/dist/cjs",
19+
"^react-dnd$": "react-dnd/dist/cjs",
20+
"^react-dnd-html5-backend$": "react-dnd-html5-backend/dist/cjs",
21+
"^react-dnd-touch-backend$": "react-dnd-touch-backend/dist/cjs",
22+
"^react-dnd-test-backend$": "react-dnd-test-backend/dist/cjs",
23+
"^react-dnd-test-utils$": "react-dnd-test-utils/dist/cjs"
1724
},
1825
testRegex: '.*spec.ts$',
1926
moduleFileExtensions: [
@@ -22,8 +29,6 @@ module.exports = {
2229
'ts',
2330
],
2431
transformIgnorePatterns: [
25-
// the dnd folks started building esnext with import/export statements
26-
'/node_modules/(?!dnd-core|react-dnd-test-backend)/',
2732
'/dist/',
2833
],
2934
modulePathIgnorePatterns: [

0 commit comments

Comments
 (0)