No more setTimeout in tests
There is no need to use setTimeout()
in frontend tests and we should discourage its use. It currently appears in the following situations:
waiting for an Ajax call
Instead the test should use .then()
or .catch()
of the axios request to wait.
waiting for Vue to update a component
Instead the test should use Vue.nextTick()
.
setTimeout()
in the application (for example for polling)
waiting for a Instead the test should use the Jasmine Clock.
waiting for a DOM / jQuery event
Instead the test should register an event listener.
Edited by Inactive Account