Jest 스냅샷 테스트 관련 오류
2022. 8. 16. 01:38ㆍ서버 프로그래밍
로컬에서는 문제없이 테스트가 실행되지만, CI/CD 파이프라인에서는 다음과 같은 오류가 발생한다.
New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.
To resolve this, we will need to update our snapshot artifacts. You can run Jest with a flag that will tell it to re-generate snapshots:
jest --updateSnapshot
https://jestjs.io/docs/snapshot-testing