Skip to content

Commit

Permalink
Merge pull request #229 from sibiraj-s/update-jest
Browse files Browse the repository at this point in the history
Support Jest 25
  • Loading branch information
lmiller1990 committed Jun 8, 2020
2 parents 7189409 + 72b43d7 commit 966dd34
Show file tree
Hide file tree
Showing 3 changed files with 871 additions and 650 deletions.
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

0 comments on commit 966dd34

Please sign in to comment.