|
24 | 24 | "lint:eslint": "yarn eslint client --ext \".js,.jsx,.ts\"", |
25 | 25 | "lint:prettier": "yarn prettier \"**/*.@(js|jsx)\" --list-different", |
26 | 26 | "lint": " yarn lint:eslint --fix && yarn lint:prettier --w", |
27 | | - "test": "yarn build:test && yarn lint", |
28 | | - "test:client": "cd client && yarn test", |
| 27 | + "test": "yarn build:test && yarn lint && yarn jest", |
| 28 | + "test:client": "yarn jest", |
29 | 29 | "build:test": "rm -rf public/packs-test && RAILS_ENV=test NODE_ENV=test bin/shakapacker", |
30 | 30 | "build:dev": "rm -rf public/packs && RAILS_ENV=development NODE_ENV=development bin/shakapacker", |
31 | 31 | "build:clean": "rm -rf public/packs || true" |
|
35 | 35 | "@babel/core": "^7.21.0", |
36 | 36 | "@babel/plugin-transform-runtime": "^7.21.0", |
37 | 37 | "@babel/preset-env": "^7.20.2", |
38 | | - "@babel/preset-react": "^7.18.6", |
39 | 38 | "@babel/runtime": "^7.17.9", |
40 | 39 | "@glennsl/rescript-fetch": "^0.2.0", |
41 | 40 | "@glennsl/rescript-json-combinators": "^1.2.1", |
|
49 | 48 | "ajv": "^8.17.1", |
50 | 49 | "autoprefixer": "^10.4.14", |
51 | 50 | "axios": "^0.21.1", |
52 | | - "babel-loader": "^9.1.2", |
53 | | - "babel-plugin-macros": "^3.1.0", |
54 | | - "babel-plugin-transform-react-remove-prop-types": "^0.4.24", |
55 | 51 | "classnames": "^2.3.2", |
56 | 52 | "compression-webpack-plugin": "10.0.0", |
57 | 53 | "css-loader": "^6.7.3", |
|
110 | 106 | }, |
111 | 107 | "devDependencies": { |
112 | 108 | "@babel/eslint-parser": "^7.16.5", |
| 109 | + "@babel/preset-react": "^7.18.6", |
113 | 110 | "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", |
114 | 111 | "@tailwindcss/typography": "^0.5.10", |
| 112 | + "@testing-library/dom": "^10.4.1", |
| 113 | + "@testing-library/jest-dom": "^6.9.1", |
| 114 | + "@testing-library/react": "^16.3.0", |
115 | 115 | "@webpack-cli/serve": "^2.0.5", |
116 | 116 | "babel-jest": "^29.5.0", |
117 | 117 | "body-parser": "^1.20.2", |
|
129 | 129 | "express": "^4.18.2", |
130 | 130 | "identity-obj-proxy": "^3.0.0", |
131 | 131 | "jest": "^29.5.0", |
| 132 | + "jest-environment-jsdom": "^30.2.0", |
132 | 133 | "mini-css-extract-plugin": "^2.7.2", |
133 | 134 | "preload-webpack-plugin": "^3.0.0-alpha.1", |
134 | 135 | "prettier": "^2.2.1", |
|
150 | 151 | "not IE 11" |
151 | 152 | ], |
152 | 153 | "jest": { |
| 154 | + "testEnvironment": "jsdom", |
153 | 155 | "moduleNameMapper": { |
154 | 156 | "\\.scss$": "identity-obj-proxy" |
155 | 157 | }, |
156 | | - "setupFiles": [ |
157 | | - "./app/libs/testHelper.js" |
| 158 | + "setupFilesAfterEnv": [ |
| 159 | + "./client/app/libs/jestSetup.js" |
158 | 160 | ], |
159 | | - "testRegex": "./app/.*.spec\\.jsx?$", |
| 161 | + "testRegex": "./client/(app|__tests__)/.*.spec\\.jsx?$", |
160 | 162 | "transform": { |
161 | 163 | "^.+\\.jsx?$": "babel-jest" |
162 | 164 | } |
|
0 commit comments