Skip to content

Commit

Permalink
Feature/arackis/make work with d3 v7 (#307)
Browse files Browse the repository at this point in the history
* Install d3, update Jest to transpile d3

* Fix unit tests - negative numbers were using the wrong negative unicode character

* Include d3@6 as acceptable

* Undo whitespace changes in jest config
  • Loading branch information
arackaf authored Sep 1, 2021
1 parent 3da0d38 commit 0527b6f
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 29,906 deletions.
26 changes: 0 additions & 26 deletions .babelrc

This file was deleted.

26 changes: 26 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: '> 3%',
},
},
],
'@babel/preset-react',
'@babel/preset-flow',
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
],
env: {
production: {
plugins: ['lodash'],
},
test: {
plugins: ['babel-plugin-rewire'],
},
},
};
22 changes: 11 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const dontTranspiledThese = ['internmap', 'delaunator', 'robust-predicates'];
const dontTranspile = dontTranspiledThese.join('|');

const config = {
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.js'
],
setupFiles: [
'<rootDir>/tests/jsdom/setup.js'
],
setupFilesAfterEnv: [
'./node_modules/jest-enzyme/lib/index.js'
],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.js'],
setupFiles: ['<rootDir>/tests/jsdom/setup.js'],
setupFilesAfterEnv: ['./node_modules/jest-enzyme/lib/index.js'],
transformIgnorePatterns: [
`[/\\\\]node_modules[/\\\\]((?!(?<=[/\\\\])(d3-?|${dontTranspile})).)+\\.(js|jsx|ts|tsx)$`,
],
};

module.exports = config;
module.exports = config;
Loading

0 comments on commit 0527b6f

Please sign in to comment.