Skip to content

Commit 14e1451

Browse files
build: configure jest to transform es module for d3-quadtree
1 parent 60f4609 commit 14e1451

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/motif/jest.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ export default {
165165

166166
// A map from regular expressions to paths to transformers
167167
transform: {
168-
'/node_modules/lodash-es/.+\\.(j|t)sx?$': 'ts-jest',
168+
'/node_modules/(lodash-es|d3-quadtree)/.+\\.(j|t)sx?$': 'ts-jest',
169169
},
170170

171171
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
172-
transformIgnorePatterns: ['/node_modules/(?!lodash-es|@cylynx/graphin)'],
172+
transformIgnorePatterns: [
173+
'<rootDir>/node_modules/?!(lodash-es|@cylynx/graphin)',
174+
],
173175

174176
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
175177
// unmockedModulePathPatterns: undefined,

packages/motif/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"@types/d3-axis": "^2.0.0",
7777
"@types/d3-brush": "^2.1.0",
7878
"@types/d3-format": "^2.0.0",
79+
"@types/d3-quadtree": "^3.0.2",
7980
"@types/d3-scale": "^3.2.1",
8081
"@types/d3-scale-chromatic": "^2.0.0",
8182
"@types/d3-selection": "^2.0.0",

0 commit comments

Comments
 (0)