Skip to content

Commit 7c72ac3

Browse files
committed
Fix unit test
1 parent 26d234a commit 7c72ac3

File tree

7 files changed

+1859
-1453
lines changed

7 files changed

+1859
-1453
lines changed

.babelrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"presets": [
3-
"react",
4-
"env",
5-
"stage-0"
6-
]
7-
}
3+
"@babel/preset-env",
4+
"@babel/preset-react"
5+
],
6+
"plugins": ["babel-plugin-styled-components"]
7+
}

lib/Cartesian.js

Lines changed: 2 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1837 additions & 1427 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "react-cartesian",
33
"version": "1.0.4",
44
"description": "Cartesian product react component",
5+
"type": "module",
56
"module": "src/Cartesian.js",
67
"main": "lib/Cartesian.js",
78
"repository": {
@@ -34,11 +35,12 @@
3435
"react-dom": "^16.12.0"
3536
},
3637
"devDependencies": {
37-
"babel-core": "^6.21.0",
38-
"babel-loader": "^7.1.4",
39-
"babel-preset-env": "^1.6.1",
40-
"babel-preset-react": "^6.16.0",
41-
"babel-preset-stage-0": "^6.24.1",
38+
"@babel/core": "^7.8.4",
39+
"@babel/preset-env": "^7.8.4",
40+
"@babel/preset-react": "^7.8.3",
41+
"babel-plugin-styled-components": "^1.10.7",
42+
"enzyme": "^3.11.0",
43+
"enzyme-adapter-react-16": "^1.15.2",
4244
"path": "^0.12.7",
4345
"react": "^16.0.0",
4446
"react-dom": "^16.0.0",

setupTests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { configure } from "enzyme";
2+
import Adapter from "enzyme-adapter-react-16";
3+
4+
configure({ adapter: new Adapter() });

src/Cartesian.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCartesianProduct, getCartesianProps, getJSX } from "./Cartesian";
1+
import { getCartesianProduct, getCartesianProps } from "./Cartesian";
22

33
describe("getCartesianProduct", () => {
44
it("should return empty array for empty array input", () => {

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ module.exports = {
1616
use: 'babel-loader'
1717
}
1818
]
19+
},
20+
externals: {
21+
react: "commonjs react"
1922
}
2023
}

0 commit comments

Comments
 (0)