์ฌํํ๋ ค๋ฉด:
๊ฒฐ๊ณผ:
FAIL ํ ์คํธ /Intro-test.js(0.459์ด)
โ ์๊ฐ โบ ์ฌ๋ฐ๋ฅด๊ฒ ๋ ๋๋ง๋ฉ๋๋ค.
- TypeError: ์ ์๋์ง ์์ '_tag' ์์ฑ์ ์ฝ์ ์ ์์ต๋๋ค.
ReactNativeBaseComponent.Mixin.mountComponent์์ (node_modules/react/lib/ReactNativeBaseComponent.js:179:45)
Object.ReactReconciler.mountComponent์์ (node_modules/react/lib/ReactReconciler.js:47:35)
ReactCompositeComponentMixin.performInitialMount์์ (node_modules/react/lib/ReactCompositeComponent.js:397:34)
ReactCompositeComponentMixin.mountComponent์์ (node_modules/react/lib/ReactCompositeComponent.js:262:21)
Object.ReactReconciler.mountComponent์์ (node_modules/react/lib/ReactReconciler.js:47:35)
ReactCompositeComponentMixin.performInitialMount์์ (node_modules/react/lib/ReactCompositeComponent.js:397:34)
ReactCompositeComponentMixin.mountComponent (node_modules/react/lib/ReactCompositeComponent.js:262:21)
Object.ReactReconciler.mountComponent์์ (node_modules/react/lib/ReactReconciler.js:47:35)
ReactMultiChild.Mixin.mountChildren์์ (node_modules/react/lib/ReactMultiChild.js:242:44)
ReactTestComponent.mountComponent (node_modules/react/lib/ReactTestRenderer.js:53:8)
https://facebook.github.io/jest/docs/tutorial-react-native.html#mock -native-modules-using-jest-mock์ ๋ฐ๋ผ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋ค์์ ์ถ๊ฐํ๋ ๊ฒ์ ๋๋ค.
jest.mock('TextInput', () => 'TextInput');
ํ ์คํธ ์์๊น์ง.
TextInput์ ๋ํ ๊ธฐ๋ณธ ๋ชจ์๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค.
Jest 15์ ๊ฒฝ์ฐ https://github.com/facebook/jest/pull/1516 ์์ ์์ ๋์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
https://facebook.github.io/jest/docs/tutorial-react-native.html#mock -native-modules-using-jest-mock์ ๋ฐ๋ผ ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋ค์์ ์ถ๊ฐํ๋ ๊ฒ์ ๋๋ค.
jest.mock('TextInput', () => 'TextInput');
ํ ์คํธ ์์๊น์ง.