[Vuejs]-Vue.js + Jest : how to test a form post?

0👍

You should prevent submit and post data using axios for example and then mock axios.

<!-- the submit event will no longer reload the page -->
<form v-on:submit.prevent="onSubmit"></form>

It’s an easier way to unit-test that.

Leave a comment