이미 push 후 PR까지 한 것에 대해 수정요청이 왔다.
"기존 구독신청에서 신문구독으로 텍스트 수정하는 간단작업"
ARC통해 변경 및 Push를 하니
엥??
circleCI 오류랜다.
읽어보니..
Summary of all failing tests
FAIL components/features/global/nav/_children/auth-menu/index.test.jsx
● <AuthMenu> › should match snapshot
expect(received).toMatchSnapshot()
Snapshot name: `<AuthMenu> should match snapshot 1`
- Snapshot
+ Received
- <Link
+ <div
className="flex flex--justify-end flex--align-items-center"
- href="/subscribe/signin/"
>
<Login
type="sm"
/>
- </Link>
+ </div>
22 | it('should match snapshot', () => {
23 | const wrapper = shallow(<AuthMenu {...props} />);
> 24 | expect(toJSON(wrapper)).toMatchSnapshot();
| ^
25 | });
26 | });
27 |
at Object.<anonymous> (components/features/global/nav/_children/auth-menu/index.test.jsx:24:29)
Snapshot Summary
› 1 snapshot failed from 1 test suite. Inspect your code changes or run `npm test -- -u` to update them.
Test Suites: 1 failed, 334 passed, 335 total
Tests: 1 failed, 7 skipped, 1 todo, 2296 passed, 2305 total
Snapshots: 1 failed, 165 passed, 166 total
Time: 90.491s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Chosun-PageBuilder-Fusion-Features@0.0.0 test: `jest --coverage --maxWorkers 4`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Chosun-PageBuilder-Fusion-Features@0.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/circleci/.npm/_logs/2022-04-27T05_36_57_947Z-debug.log
Exited with code exit status 1
- npm cache 삭제
- npm cache clean -f
- node_moudles,package-lock.json삭제
- rm -rf node_modules
- npm 재설치
- npm install
위 것들보다도 근본적인 문제.
지금까지 VC의 터미널창에서 push를 해줬었고 snapshot이라는걸 안해왔다.
jest로 테스트 할일이 없었기 때문.
차장님이 하시는 방법데로, VC의 사이드바에서 +버튼으로 staging해주고,
글자를 적은 후 v표시를 누르면 commit이 명령어 없이 되는데,
이때 변화된 snapshot도 함께 staging,commit해줘야한다.
지금까진 그걸 안해주서 발생했던 문제!
그 후 최종적으로 push를 해주면 CircleCI 에러가 사라진 걸 볼 수 있다.