Skip to content

Commit b98b077

Browse files
committed
chore: elaborate on the new jest presets
1 parent 2125737 commit b98b077

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11

22
## 4.0.0-rc.4 (2019-09-25)
33

4+
Start from the version, the `unit-jest` plugin now comes with four configuration presets:
5+
6+
- `@vue/cli-plugin-unit-jest` The default preset for the most common type of projects
7+
- `@vue/cli-plugin-unit-jest/presets/no-babel` If you don't have `@vue/cli-plugin-babel` installed and don't want to see babel files in the project
8+
- `@vue/cli-plugin-unit-jest/presets/typescript` The preset with TypeScript support (but no TSX support)
9+
- `@vue/cli-plugin-unit-jest/presets/typescript-and-babel` The preset with TypeScript (and TSX) and babel suuport.
10+
11+
If you haven't changed the default Jest configurations (lies in either `jest.config.js` or the `jest` field in `package.json`) ever since project creation, you can now replace the massive configuration object with one single field:
12+
13+
```js
14+
module.exports = {
15+
// Replace the following preset name with the one you want to use from the above list
16+
preset: '@vue/cli-plugin-unit-jest'
17+
}
18+
```
19+
20+
A reminder:
21+
The default test environment in the new presets is jsdom@15, which differs from the default one in Jest 24 (jsdom@11).
22+
This is to be align with the upcoming Jest 25 changes.
23+
Most users won't be affected by this change.
24+
For a detailed changelog with regard to jsdom, see https://github.com/jsdom/jsdom/blob/master/Changelog.md
25+
426
#### :rocket: New Features
527
* `@vue/cli-plugin-unit-jest`
628
* [#4607](https://github.com/vuejs/vue-cli/pull/4607) feat: use jsdom v15 in jest presets instead of the default v11 ([@sodatea](https://github.com/sodatea))

0 commit comments

Comments
 (0)