Need help with jest-vue-preprocessor?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

133 Stars 27 Forks MIT License 149 Commits 40 Opened issues


Preprocessor that allows importing of .vue files in jest tests

Services available


Need anything else?

Contributors list


Greenkeeper badge Build Status npm version codecov Commitizen friendly

A locoslab/vue-typescript-jest JavaScript port to allow Jest load .vue files in tests. This package supports both ES6 (Babel) and TypeScript.

Portions both preprocessors are heavily based vueify (Copyright (c) 2014-2016 Evan You).


  1. add package you your project
  • yarn add --dev jest-vue-preprocessor
    npm install --saveDev jest-vue-preprocessor
  1. modify package.json's jest section by adding/editing moduleFileExtensions and transform properites:

      "jest": {
        "moduleFileExtensions": [
        "mapCoverage": true,
        "transform": {
          "^.+\\.js$": "/node_modules/babel-jest",
          ".*\\.(vue)$": "/node_modules/jest-vue-preprocessor"
  2. Start writing test that can import

    components - see example ./tests/index.spec.js
  3. Profit!

### Customization

  • non-relative component imports - you properly set jest's
    option - see #25

### Contributing guide

### License: MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.