0
Jest로 redux 액션을 테스트하려고합니다. React Native가있는 애니메이션 라이브러리를 조롱하는 문제는 계속되고 있습니다. 여기 내 (응축) 코드입니다 : 내 테스트에서Jest - React Native Animated가있는 Redux 액션 크리에이터
// action.js
const loginAction =() => {
Animated.timing(animation, {
toValue: 0,
duration: 600
}).start(() => {
dispatch({ type: 'LOGIN_SUCCESS' });
});
}
// mock-setup.js
jest.mock('Animated',() => {
return {
timing: jest.fn(() => {
return {
start: jest.fn()
};
}),
Value: jest.fn(() => {
return {
interpolate: jest.fn()
};
})
};
});
, 나는 발송 작업을 비교하려고 해요,하지만 난 start
함수의 콜백 내에서 이동 내 테스트를 얻을 수없는 것. 이견있는 사람?