2017-12-25 3 views
0

반응 네이티브 프로젝트 폴더에서 작업 중이며 시뮬레이터에서 올바르게로드 할 수 있습니다. 하지만 gitHub에 변경 사항을 적용하려고하면이 오류가 발생합니다.git commit 명령을 실행할 때 원사 오류가 발생합니다.

은 실패 커밋 - 종료 코드 1 출력 수신 : '허스키> NPM 실행 -s precommit (노드 v8.9.3)

원사 실행 v1.3.2 $의 농담 & & eslint합니다. 이 ●이

expect(value).toMatchSnapshot() 

Received value does not match stored snapshot 1. 

- Snapshot 
+ Received 

@@ -98,14 +98,45 @@ 
      testID={undefined} 
      tvParallaxProperties={undefined} 
      > 
      <Text 
       accessible={true} 
-    allowFontScaling={true} 
+    active={true} 
+    allowFontScaling={false} 
       disabled={false} 
       ellipsizeMode="tail" 
-   /> 
+    style={ 
+    Array [ 
+     Object { 
+     "color": undefined, 
+     "fontSize": 12, 
+     }, 
+     Array [ 
+     Object { 
+      "color": "#000", 
+      "fontSize": 30, 
+     }, 
+     Object { 
+      "color": "#007aff", 
+      "fontSize": 33, 
+      "marginLeft": 2, 
+      "marginRight": 2, 
+      "marginTop": 2, 
+      "paddingTop": 2, 
+     }, 
+     ], 
+     Object { 
+     "fontFamily": "Ionicons", 
+     "fontStyle": "normal", 
+     "fontWeight": "normal", 
+     }, 
+    ] 
+    } 
+    virtual={undefined} 
+   > 
+     
+   </Text> 
      </View> 
     </View> 
     <View 
      style={ 
      Object { 

    at Object.<anonymous> (src/screens/Compose/__tests__/index.test.js:9:14) 
    at tryCallTwo (node_modules/promise/lib/core.js:45:5) 
    at doResolve (node_modules/promise/lib/core.js:200:13) 
    at new Promise (node_modules/promise/lib/core.js:66:3) 
    at Promise.resolve.then.el (node_modules/p-map/index.js:46:16) 
    at tryCallOne (node_modules/promise/lib/core.js:37:12) 
    at node_modules/promise/lib/core.js:123:15 

이 ✕ 정확하게 렌더링 제대로 렌더링 작성/테스트/ /index.test.js 를 SRC/화면 FAIL (71ms)

스냅 샷 요약 > 1 스냅 샷 테스트 1 개 테스트 스위트 실패 . 코드 변경 사항을 검사하거나 yarn test -- -u으로 실행하여 업데이트하십시오.

테스트 스위트 : 1, 1 개 총 테스트를 실패 : 1, 1 개 총 스냅 샷을 실패 : 1, 1 총 시간을 실패 : 1.027s 모든 테스트 스위트를 실행. 오류 명령이 종료 코드 1과 함께 실패했습니다. 정보이 명령에 대한 설명은 https://yarnpkg.com/en/docs/cli/run을 참조하십시오.

거친> 후크 사전 커밋은 잠시 굴착 후 '

답변

0

을 [# 4992 (https://github.com/facebook/jest/pull/4992)을 (수동으로 --no가 검증 추가) 실패하고, [여기서 (https://facebook.github.io/jest/docs/en/snapshot-testing.html#how-do-i-resolve-conflicts-within-snapshot-files) 는 I는 삭제 "index.test.js.snap"을 입력하고 스냅 샷 업데이트 명령을 실행하면 "index.test.js.snap"이 다시 생성되어 내 문제가 해결됩니다.

rm src/screens/Compose/__tests__/__snapshots__/index.test.js.snap 
npm test -- -u 
관련 문제