인프런 커뮤니티 질문&답변

gonieyoo님의 프로필 이미지
gonieyoo

작성한 질문수

따라하며 배우는 도커와 CI환경 [2023.11 업데이트]

.travis.yml 파일 작성하기 (테스트까지)

.travis.yml 파일 작성하기 과정 중에 아무리해도 테스트가 성공이 안됩니다.

작성

·

369

0

.travis.yml 파일 작성 후에 깃 커밋하고

sudo: required

language: generic

services:
  - docker

before-install:
  - echo "start creating an image with dockerfile"
  - docker build -t gonieyoo720/docker-react-app -f Dockerfile.dev .

script:
  - docker run -e CI=true gonieyoo720/docker-react-app npm run test -- --coverage

after_success:
  - echo "Test Success"

트래비스에까지 테스트를 돌렸는데, 몇번을 수정하고 해봐도

트래비스에서 테스트를 통과하지 못하네요.

오타 확인도 많이 해봤는데, 해결을 못하고있습니다.

테스트에 중지되지않은 비동기작업이 있다고 오류를 해결하려면 devDependency를 추가하라는데, 어떻게 해야할까요

--------------------|---------|----------|---------|---------|-------------------
File                | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
--------------------|---------|----------|---------|---------|-------------------
All files           |    8.33 |        0 |   33.33 |    8.33 |                   
 App.js             |     100 |      100 |     100 |     100 |                   
 index.js           |       0 |      100 |     100 |       0 | 7-17              
 reportWebVitals.js |       0 |        0 |       0 |       0 | 1-8               
--------------------|---------|----------|---------|---------|-------------------
Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        2.06 s
Ran all test suites.
Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
  
The command "docker run -e CI=true gonieyoo720/docker-react-app npm run test -- --coverage" exited with 1.
Done. Your build exited with 1.

답변 1

0

John Ahn님의 프로필 이미지
John Ahn
지식공유자

안녕하세요

테스트가 실패한걸로 보이는데 우선 로컬에서 테스트를 할때는 테스트가 통과가 되나요?

gonieyoo님의 프로필 이미지
gonieyoo
질문자

docker-react-app-tests-1  | One of your dependencies, babel-preset-react-app, is importing the
docker-react-app-tests-1  | "@babel/plugin-proposal-private-property-in-object" package without
docker-react-app-tests-1  | declaring it in its dependencies. This is currently working because
docker-react-app-tests-1  | "@babel/plugin-proposal-private-property-in-object" is already in your
docker-react-app-tests-1  | node_modules folder for unrelated reasons, but it may break at any time.
docker-react-app-tests-1  | 
docker-react-app-tests-1  | babel-preset-react-app is part of the create-react-app project, which
docker-react-app-tests-1  | is not maintianed anymore. It is thus unlikely that this bug will
docker-react-app-tests-1  | ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
docker-react-app-tests-1  | your devDependencies to work around this error. This will make this message
docker-react-app-tests-1  | go away.
gonieyoo님의 프로필 이미지
gonieyoo
질문자

로컬테스트에서는 "babel-preset-react-app"이라는 패키지때문에 오류가 나오고 있습니다.

일전에 패키지가 설치되어있지않아,

npm install --save-dev @babel/plugin-proposal-private-property-in-object

터미널에서 강제로 해당 패키지를 설치했으나, 종속성 선언 문제로 오류가 계속 발생하는데, 해결방법을 모르겠습니다.

gonieyoo님의 프로필 이미지
gonieyoo
질문자

답답한 마음에 다시 다 지우고 리액트 처음부터 설치하는 부분으로 가는데, 빌드때부터 다음의 메세지가 나오는 것으로 보아, 제 컴퓨터에서 해당 과정을 동일하게 진행했을때 문제가 발생하는 것으로 보입니다.

 

One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.

babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
gonieyoo님의 프로필 이미지
gonieyoo

작성한 질문수

질문하기