Mohd Kashif

Mohd Kashif

  • 858
  • 941
  • 221.5k

unit test case for plugin directive in vue js

Sep 16 2019 5:22 AM
I am trying to write the unit test case for plugin custom directive but not able to understand from where should I start?
 
file - directives.js
 
export default {
install: function(Vue, options) {
// directive to check development env
Vue.directive("development", {
bind(el, binding, vnode) {
debug("directives.development-bind", vnode);
if (!(options.env && options.env.NODE_ENV === "devs")) {
el.innerHTML = "";
} else {
el.classList.add("development");
}
}
});
}
}
 
please suggest to me how to write a unit test using jest?