Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Jest 25 #229

Merged
merged 6 commits into from Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 2 additions & 11 deletions README.md
Expand Up @@ -2,22 +2,14 @@

Jest Vue transformer with source map support

> **NOTE:** This is documentation for `vue-jest@3.x`. [View the vue-jest@2.x documentation](https://github.com/vuejs/vue-jest/tree/e694fc7ce11ae1ac1c778ed7c4402515c5f0d5aa)
> **NOTE:** This is documentation for `vue-jest@4.x`. [View the vue-jest@3.x documentation](https://github.com/vuejs/vue-jest/tree/v3)

## Usage

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

### Usage with Babel 7

If you use [jest](https://github.com/facebook/jest) < 24.0.0 and [babel-jest](https://github.com/facebook/jest/tree/master/packages/babel-jest) make sure to install babel-core@bridge

```bash
npm install --save-dev babel-core@bridge
```

## Setup

To define `vue-jest` as a transformer for your `.vue` files, map them to the `vue-jest` module:
Expand All @@ -28,6 +20,7 @@ To define `vue-jest` as a transformer for your `.vue` files, map them to the `vu
"transform": {
"^.+\\.vue$": "vue-jest"
}
}
}
```

Expand All @@ -45,8 +38,6 @@ A full config will look like this.
}
```

If you're on a version of Jest older than 22.4.0, you need to set `mapCoverage` to `true` in order to use source maps.

## Example Projects

Example repositories testing Vue components with jest and vue-jest:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -48,7 +48,7 @@
"hamljs": "^0.6.2",
"husky": "^1.1.4",
"jade": "^1.11.0",
"jest": "^24.0.0",
"jest": "^25.1.0",
"less": "^3.9.0",
"lint-staged": "^8.0.5",
"prettier": "^1.16.1",
Expand All @@ -62,7 +62,7 @@
},
"peerDependencies": {
"@babel/core": "7.x",
"jest": "^24.x",
"jest": "^25.x",
"vue": "^2.x",
"vue-template-compiler": "^2.x"
},
Expand All @@ -73,7 +73,7 @@
"convert-source-map": "^1.6.0",
"extract-from-css": "^0.4.4",
"source-map": "0.5.6",
"ts-jest": "^24.0.0"
"ts-jest": "^25.2.1"
},
"repository": {
"type": "git",
Expand Down