Skip to content

blake-newman/jest-vue-preprocessor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jest-vue-preprocessor

Build Status npm version codecov

A locoslab/vue-typescript-jest JavaScript port to allow Jest load .vue files in tests.

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

Installation

  1. add package you your project
  • yarn add --dev jest-vue-preprocessor or npm install --saveDev jest-vue-preprocessor
  1. modify package.json's jest section by adding/editing moduleFileExtensions and transform properites:
```json
"jest": {
  "moduleFileExtensions": [
    "js",
    "vue"
  ],
  "transform": {
    "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
    ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue-preprocessor"
  }
}
```
  1. Start writing test that can import *.vue components - see example ./tests/index.spec.js
  2. Profit!

About

Preprocessor that allows importing of .vue files in jest tests

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%