# jest-vue-preprocessor-wsm

> Preprocessor that allows importing of .vue files in jest tests

Latest version **1.2.0** (published 2017-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-vue-preprocessor-wsm
pnpm add jest-vue-preprocessor-wsm
yarn add jest-vue-preprocessor-wsm
bun add jest-vue-preprocessor-wsm
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2017-09-26 |
| First published | 2017-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.3 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Viliam Elischer |
| Maintainers | xiphe |
| Keywords | jest, vue, test, preprocessor, transform |

## Links

- npm: https://www.npmjs.com/package/jest-vue-preprocessor-wsm
- Repository: https://github.com/vire/jest-vue-preprocessor
- Homepage: https://github.com/vire/jest-vue-preprocessor#readme
- Issues: https://github.com/vire/jest-vue-preprocessor/issues
- npm.io page: https://npm.io/package/jest-vue-preprocessor-wsm

## Dependencies (4)

- [typescript](https://npm.io/package/typescript.md) 2.4.2
- [find-babel-config](https://npm.io/package/find-babel-config.md) 1.1.0
- [vue-property-decorator](https://npm.io/package/vue-property-decorator.md) 5.1.1
- [babel-plugin-transform-runtime](https://npm.io/package/babel-plugin-transform-runtime.md) 6.23.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2017-09-26

## README

# jest-vue-preprocessor
[![Build Status](https://travis-ci.org/vire/jest-vue-preprocessor.svg?branch=master)](https://travis-ci.org/vire/jest-vue-preprocessor) [![npm version](https://badge.fury.io/js/jest-vue-preprocessor.svg)](https://badge.fury.io/js/jest-vue-preprocessor) [![codecov](https://codecov.io/gh/vire/jest-vue-preprocessor/branch/master/graph/badge.svg)](https://codecov.io/gh/vire/jest-vue-preprocessor) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)


A [locoslab/vue-typescript-jest](https://github.com/locoslab/vue-typescript-jest) JavaScript port to allow Jest load [.vue files](https://vue-loader.vuejs.org/en/) in tests. This package supports both ES6 (Babel) and TypeScript.

Portions both preprocessors are heavily based [vueify](https://github.com/vuejs/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`
 
  2.  modify package.json's **jest** section by adding/editing **moduleFileExtensions** and **transform** properites:

      ```javascript
      "jest": {
        "moduleFileExtensions": [
          "js",
          "vue"
        ],
        "mapCoverage": true,
        "transform": {
          "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
          ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue-preprocessor"
        }
      }
      ```
  3.  Start writing test that can import `*.vue` components - see example **./tests/index.spec.js**
  4.  Profit!

  ### Customization

  * non-relative component imports - you properly set jest's `moduleMapper` option - see [#25](https://github.com/vire/jest-vue-preprocessor/issues/25)

  ### [Contributing guide](https://github.com/vire/jest-vue-preprocessor/blob/master/CONTRIBUTING.md)

  ### License: MIT

---
_Source: https://npm.io/package/jest-vue-preprocessor-wsm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
