# jest-vue

> Jest Vue transform

Latest version **0.8.2** (published 2017-10-24) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.2 |
| Published | 2017-10-24 |
| First published | 2017-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Edd Yerburgh |
| Maintainers | eddyerburgh |
| Keywords | jest, vue, jest vue, jest vue transform, jest vue preprocessor, jest-vue, vue jest, vue jest transform, vue jest preprocessor |

## Links

- npm: https://www.npmjs.com/package/jest-vue
- npm.io page: https://npm.io/package/jest-vue

## Dependencies (11)

- [chalk](https://npm.io/package/chalk.md) ^2.1.0
- [tsconfig](https://npm.io/package/tsconfig.md) ^7.0.0
- [babel-core](https://npm.io/package/babel-core.md) ^6.25.0
- [node-cache](https://npm.io/package/node-cache.md) ^4.1.1
- [source-map](https://npm.io/package/source-map.md) ^0.5.6
- [js-beautify](https://npm.io/package/js-beautify.md) ^1.6.14
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1
- [find-babel-config](https://npm.io/package/find-babel-config.md) ^1.1.0
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^1.5.0
- [babel-preset-vue-app](https://npm.io/package/babel-preset-vue-app.md) ^1.3.1
- [vue-template-es2015-compiler](https://npm.io/package/vue-template-es2015-compiler.md) ^1.5.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.8.2 (latest) — 2017-10-24
- 0.8.1 — 2017-10-11
- 0.8.0 — 2017-10-10
- 0.7.2 — 2017-10-06
- 0.7.1 — 2017-10-06
- 0.7.0 — 2017-10-02
- 0.6.0 — 2017-10-01
- 0.5.6 — 2017-09-19
- 0.5.5 — 2017-09-19
- 0.5.4 — 2017-09-19
- 0.5.3 — 2017-09-14
- 0.5.2 — 2017-09-07
- 0.5.1 — 2017-09-06
- 0.5.0 — 2017-09-06
- 0.4.0 — 2017-09-03
- … 4 more at https://npm.io/package/jest-vue/versions

## README

# jest-vue

Jest Vue transformer with source map support

## DEPRECATED

this package has been renamed to vue-jest

You can download vue-jest with the following command:

```
npm install --save-dev vue-jest
```

## Usage

```
npm install --save-dev jest-vue
```

## Setup

To define jest-vue as a transformer for your .vue files, you need to map .vue files to the jest-vue module.

```
"transform": {
  ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
},
```

To use source maps, you need to set `mapCoverage` to `true`. A full config will look like this.

```json
{
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "vue"
    ],
    "transform": {
      "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
      ".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
    },
    "mapCoverage": true
  }
}
```

## Example Projects

Example repositories testing Vue components with jest and jest-vue:

- [Avoriaz with Jest](https://github.com/eddyerburgh/avoriaz-jest-example)
- [Vue Test Utils with Jest](https://github.com/eddyerburgh/vue-test-utils-jest-example)

## Supported langs

jest-vue compiles the script and template of SFCs into a JavaScript file that Jest can run. **It does not currently compile the style section**.

### Supported script languages

- **typescript** (`lang="ts"`, `lang="typescript"`)
- **coffeescript** (`lang="coffee"`, `lang="coffeescript"`)

### Supported template languages

- **pug** (`lang="pug"`)
- **jade** (`lang="jade"`)

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