Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"^.+\\.jsx?$": "babel-jest",
"\\.(ts|tsx)$": "ts-jest"
},
"transformIgnorePatterns": ["node_modules/(?!(d3-.+))"],
"transformIgnorePatterns": ["node_modules/(?!(d3-.+|uuid))"],
"moduleNameMapper": {
".*\\.(css|less|styl|scss|sass)$": "<rootDir>/jest/mocks/cssModule.js",
"^uuid$": "<rootDir>/node_modules/uuid/dist/index.js",
"(.*)\\.js$": "$1"
},
"setupFilesAfterEnv": ["<rootDir>/jest/setup.ts"],
Expand Down
6 changes: 6 additions & 0 deletions jest/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@ import raf from './polyfills/raf';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

// jsdom's test environment doesn't expose the Web Crypto API that uuid v14 relies on.
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { webcrypto } = require('crypto');
// @ts-ignore
if (!global.crypto) global.crypto = webcrypto;

// @ts-ignore
configure({ adapter: new Adapter() });
21 changes: 13 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"d3-shape": "^1.3.7",
"d3-zoom": "^3.0.0",
"dequal": "^2.0.2",
"uuid": "^8.3.1"
"uuid": "^14"
},
"peerDependencies": {
"react": "16.x || 17.x || 18.x || 19.x",
Expand Down