Vue Unit Test vue-test-utils Asynchronous problem

when doing a unit test, a click event is triggered in the test case. This event in the component is asynchronous. Assign a parameter after success. The problem is that I write a promise according to the official website if it is no problem to res directly. If the execution is delayed by 1 second. This test will fail.

or this situation should have the correct posture. Ask for guidance

clipboard.png

clipboard.png

clipboard.png error message

Mar.20,2021

ask for advice on how to wait online for similar problems


is there a problem with the execution order

Menu