No tests found, exiting with code 1 에러
해결됨
TDD 개발 방법론을 활용한 React Native 앱 개발
{ "name": "ReactNativeTDD", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "16.9.0", "react-native": "0.61.1" }, "devDependencies": { "@babel/core": "^7.6.2", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^0.0.5", "babel-jest": "^24.9.0", "eslint": "^6.5.1", "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "react-test-renderer": "16.9.0" }, "jest": { "preset": "react-native" } } __tests__ 폴더명 변경 시 yarn run test 를 하게 되면 testMatch: **/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 0 matches 이렇게 테스트가 작성된 폴더를 찾지 못하는 경우가 있습니다. 강의의 진행과 동일하게 했는데도 이렇게 에러가 나네요. 검색 결과 package.json 파일에서 "jest" : { "preset": "react-native", "testRegex": "(/tests/.*|(\\.|/)(test))\\.js$" } 이렇게 testRegex 에 대한 추가 설정을 해주고 나면 테스트 폴더가 잡힙니다. 무슨 문제인지 알고 싶습니다.
- react-native
- javascript
- react
- tdd





