[improvement] optimize jest fn called judgement (#3029)

This commit is contained in:
neverland
2019-03-21 18:57:44 +08:00
committed by GitHub
parent 7c4908a2e3
commit 8c051b8e1f
24 changed files with 63 additions and 64 deletions

View File

@@ -14,7 +14,7 @@ test('submit', () => {
const button = wrapper.find('.van-button');
button.trigger('click');
expect(submit.mock.calls[0]).toBeTruthy();
expect(submit).toHaveBeenCalled();
});
test('disable submit', () => {
@@ -34,5 +34,5 @@ test('disable submit', () => {
// disabled
const button = wrapper.find('.van-button');
button.trigger('click');
expect(submit.mock.calls[0]).toBeFalsy();
expect(submit).toHaveBeenCalledTimes(0);
});