I am testing a form component, all fields are validated with vee-validate
Currently I a injecting in my wrapper mount a validator
import VeeValidate from "vee-validate";
Vue.use(VeeValidate, { errorBagName: "errors" });
describe("ContactForm.vue", () => {
const v = new VeeValidate.Validator();
beforeEach(() => {
options = {
sync: false,
provide: () => ({
$validator: v
})
};
wrapper = shallowMount(ContactForm, options);
});
the $validator
has some functions like : init(), localize(), validateAll() , reset(), ...
that I could bypass in some of my tests
Is there anyway to mock such validator
with Jest
functions ?
thanks for feedback