|
5 | 5 | "homepage": "https://react-native-community.github.io/upgrade-helper",
|
6 | 6 | "scripts": {
|
7 | 7 | "build": "EXTEND_ESLINT=true react-app-rewired build",
|
8 |
| - "docker-test-e2e": "yarn start-and-wait && react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/.*(\\.|).e2e.spec.js?$'", |
| 8 | + "docker-test-e2e": "yarn start-and-wait && react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/.*(\\.|).e2e.spec.(js|jsx|ts|tsx)?$'", |
9 | 9 | "lint": "eslint . --cache --report-unused-disable-directives",
|
10 | 10 | "prepare": "husky install",
|
11 | 11 | "start": "EXTEND_ESLINT=true react-app-rewired start",
|
12 | 12 | "start-and-wait": "yarn start & wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 30 http://localhost:3000/",
|
13 |
| - "test": "react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/((?!e2e).)*.spec.js?$'", |
| 13 | + "test": "react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/((?!e2e).)*.spec.(js|jsx|ts|tsx)?$'", |
14 | 14 | "test-e2e": "docker-compose run tests"
|
15 | 15 | },
|
16 | 16 | "dependencies": {
|
|
37 | 37 | "devDependencies": {
|
38 | 38 | "@emotion/babel-preset-css-prop": "^11.10.0",
|
39 | 39 | "@emotion/eslint-plugin": "^11.10.0",
|
| 40 | + "@jest/globals": "^29.7.0", |
40 | 41 | "@testing-library/react": "^14.0.0",
|
| 42 | + "@types/jest": "^29.5.12", |
| 43 | + "@types/node": "^20.11.16", |
| 44 | + "@types/react": "^18.2.52", |
| 45 | + "@types/react-copy-to-clipboard": "^5.0.7", |
| 46 | + "@types/react-dom": "^18.2.18", |
| 47 | + "@types/use-persisted-state": "^0.3.4", |
| 48 | + "@typescript-eslint/eslint-plugin": "^6.20.0", |
| 49 | + "@typescript-eslint/parser": "^6.20.0", |
41 | 50 | "customize-cra": "^1.0.0",
|
42 | 51 | "eslint": "^8.35.0",
|
43 | 52 | "eslint-plugin-prettier": "^4.2.1",
|
|
47 | 56 | "prettier": "2.8.4",
|
48 | 57 | "pretty-quick": "3.1.3",
|
49 | 58 | "puppeteer": "10.0.0",
|
50 |
| - "react-app-rewired": "^2.2.1" |
| 59 | + "react-app-rewired": "^2.2.1", |
| 60 | + "ts-jest": "^29.1.2", |
| 61 | + "typescript": "^5.3.3" |
51 | 62 | },
|
52 | 63 | "browserslist": {
|
53 | 64 | "production": [
|
|
62 | 73 | ]
|
63 | 74 | },
|
64 | 75 | "eslintConfig": {
|
| 76 | + "parser": "@babel/eslint-parser", |
65 | 77 | "extends": [
|
66 | 78 | "react-app"
|
67 | 79 | ],
|
|
74 | 86 | "jsx-a11y/accessible-emoji": "off",
|
75 | 87 | "import/no-anonymous-default-export": "off",
|
76 | 88 | "react-hooks/exhaustive-deps": "off"
|
77 |
| - } |
| 89 | + }, |
| 90 | + "overrides": [ |
| 91 | + { |
| 92 | + "files": [ |
| 93 | + "src/__tests__/**/*" |
| 94 | + ], |
| 95 | + "env": { |
| 96 | + "jest": true |
| 97 | + } |
| 98 | + } |
| 99 | + ] |
78 | 100 | },
|
79 | 101 | "husky": {
|
80 | 102 | "hooks": {
|
81 |
| - "pre-commit": "pretty-quick --staged --pattern \"src/**/*.*(js|jsx)\"", |
| 103 | + "pre-commit": "pretty-quick --staged --pattern \"src/**/*.*(js|jsx|ts|tsx)\"", |
82 | 104 | "pre-push": "yarn run lint"
|
83 | 105 | }
|
84 | 106 | },
|
85 | 107 | "jest": {
|
| 108 | + "preset": "ts-jest", |
86 | 109 | "testMatch": [
|
87 |
| - "**/__tests__/**/*.spec.js" |
| 110 | + "**/__tests__/**/*.spec.(js|jsx|ts|tsx)" |
88 | 111 | ],
|
89 | 112 | "setupFilesAfterEnv": [
|
90 | 113 | "<rootDir>/jest.setup.js"
|
|
0 commit comments