# How to test Vue.js plugins and extensions

DevFeed: [How to test Vue.js plugins and extensions](<https://devfeed.tech/articles/how-to-test-vue-js-plugins-and-extensions-31847.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2017/05/how-to-test-vue.js-plugins-and-extensions/>)

Author: Chris Hager

Published: 2017-05-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [Vue.js](<https://devfeed.tech/topics/vue.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Extension](<https://devfeed.tech/topics/extension.md>), [Jest](<https://devfeed.tech/topics/jest.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Babel](<https://devfeed.tech/topics/babel.md>)

Tags: [babel](<https://devfeed.tech/tags/babel.md>), [boilerplate](<https://devfeed.tech/tags/boilerplate.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [jest](<https://devfeed.tech/tags/jest.md>), [plugins](<https://devfeed.tech/tags/plugins.md>), [python](<https://devfeed.tech/tags/python.md>), [syntax-highlighting](<https://devfeed.tech/tags/syntax-highlighting.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

A tutorial on testing Vue.js plugins and extensions with real Vue.js instances, state changes, transformation checks, and expected-error validation. It uses Jest examples and discusses linting and transpiling ES6 code to ES5 for compatibility.

## Source excerpt

This post shows how to write tests for Vue.js plugins and extensions by creating Vue.js instances, changing state and validating transformation and expected errors, to continuously verify that everything still works after updates, refactorings and merging contributions. While building python-boilerplate.com, I recently created a Vue.js plugin for syntax highlighting (vue-highlightjs), and wanted to add tests. For this I spent some time researching and testing how to properly test Vue.js plugins and extensions, and I wanted to summarize and share what I've learnt.