Skip to content

Commit

Permalink
test: add test script to each component's package.json file (#687)
Browse files Browse the repository at this point in the history
* test: add test script to components' package.json files

* test: use shared jest config
  • Loading branch information
mediremi committed Aug 13, 2021
1 parent db3b748 commit a0c360b
Show file tree
Hide file tree
Showing 43 changed files with 632 additions and 780 deletions.
3 changes: 2 additions & 1 deletion components/alert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/center/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/chip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/cover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/divider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/file-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"@dhis2/d2-i18n": "^1.1.0",
Expand Down
3 changes: 2 additions & 1 deletion components/header-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"@dhis2/app-runtime": "^2",
Expand Down
3 changes: 2 additions & 1 deletion components/help/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/intersection-detector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/label/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/layer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/legend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/logo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/notice-box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/organisation-unit-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"@dhis2/app-runtime": "^2.7.1",
Expand Down
3 changes: 2 additions & 1 deletion components/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"@dhis2/d2-i18n": "^1",
Expand Down
3 changes: 2 additions & 1 deletion components/popover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/popper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/radio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/required/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"@dhis2/d2-i18n": "^1",
Expand Down
3 changes: 2 additions & 1 deletion components/switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/tab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"@dhis2/d2-i18n": "^1",
Expand Down
3 changes: 2 additions & 1 deletion components/tag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/text-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
3 changes: 2 additions & 1 deletion components/transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
},
"scripts": {
"start": "start-storybook -c ../../storybook/config --port 5000",
"build": "d2-app-scripts build"
"build": "d2-app-scripts build",
"test": "d2-app-scripts test --jestConfig ../../jest.config.shared.js"
},
"peerDependencies": {
"react": "^16.8",
Expand Down
Loading

0 comments on commit a0c360b

Please sign in to comment.