Static GitHub Issues

[358] How to unit test js functions in the vue instance

prev: async await axios not working in current nuxt components
next: Split css build files (one css file for every page)

I have some functions in the vue component. for eg

getKey(param1, param2) {
    return param1+param2
}

onUploadComplete() {
    this.uploadCompleted = true;
    this.uploadStarted = false;
    //Need to test the properties in the instance as well
}

Also some values will be updated in the store. I Couldn't find any examples in the documentation

How can I test this?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c309">#c309</a>)</em></sub></div>