我写了以下测试:
it('Can decrement the current step', function () {
expect(reducer(TestState, { type: 'GOTO_PREVIOUS_STEP' })).toMatchObject({ currentStep: 4 });
});
it('Can decrement the current step v2', function () {
expect(reducer(TestState, { type: 'GOTO_PREVIOUS_STEP' })).toEqual(expect.objectContaining({ currentStep: 4 }));
});
Run Code Online (Sandbox Code Playgroud)
他们俩似乎都通过了考试,他们之间有什么区别吗?他们之间有性能影响吗?