Skip to content

Commit eb0bd58

Browse files
committed
docs: use vue-jest instead of jest-vue
1 parent a88d9bb commit eb0bd58

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

docs/en/guides/choosing-a-test-runner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ There are many popular JavaScript test runners, and `vue-test-utils` works with
66

77
There are a few things to consider when choosing a test runner though: feature set, performance, and support for single-file component (SFC) pre-compilation. After carefully comparing existing libraries, here are two test runners that we recommend:
88

9-
- [Jest](https://facebook.github.io/jest/docs/en/getting-started.html#content) is the most fully featured test runner. It requires the least configuration, sets up JSDOM by default, provides built-in assertions, and has a great command line user experience. However, you will need a preprocessor to be able to import SFC components in your tests. We have created the `jest-vue` preprocessor which can handle most common SFC features, but it currently does not have 100% feature parity with `vue-loader`.
9+
- [Jest](https://facebook.github.io/jest/docs/en/getting-started.html#content) is the most fully featured test runner. It requires the least configuration, sets up JSDOM by default, provides built-in assertions, and has a great command line user experience. However, you will need a preprocessor to be able to import SFC components in your tests. We have created the `vue-jest` preprocessor which can handle most common SFC features, but it currently does not have 100% feature parity with `vue-loader`.
1010

1111
- [mocha-webpack](https://github.com/zinserjan/mocha-webpack) is a wrapper around webpack + Mocha, but with a more streamlined interface and watch mode. The benefits of this setup is that we can get complete SFC support via webpack + `vue-loader`, but it requires more configuration upfront.
1212

@@ -29,7 +29,7 @@ require('jsdom-global')()
2929

3030
Single-file Vue components (SFCs) require pre-compilation before they can be run in Node or in the browser. There are two recommended ways to perform the compilation: with a Jest preprocessor, or directly use webpack.
3131

32-
The `jest-vue` preprocessor supports basic SFC functionalities, but currently does not handle style blocks or custom blocks, which are only supported in `vue-loader`. If you rely on these features or other webpack-specific configurations, you will need to use a webpack + `vue-loader` based setup.
32+
The `vue-jest` preprocessor supports basic SFC functionalities, but currently does not handle style blocks or custom blocks, which are only supported in `vue-loader`. If you rely on these features or other webpack-specific configurations, you will need to use a webpack + `vue-loader` based setup.
3333

3434
Read the following guides for different setups:
3535

docs/en/guides/testing-SFCs-with-jest.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Next we need to define a unit script in our `package.json`.
2727

2828
## Processing SFCs in Jest
2929

30-
To teach Jest how to process `*.vue` files, we will need to install and configure the `jest-vue` preprocessor:
30+
To teach Jest how to process `*.vue` files, we will need to install and configure the `vue-jest` preprocessor:
3131

3232
``` bash
33-
npm install --save-dev jest-vue
33+
npm install --save-dev vue-jest
3434
```
3535

3636
Next, create a `jest` block in `package.json`:
@@ -46,15 +46,15 @@ Next, create a `jest` block in `package.json`:
4646
"vue"
4747
],
4848
"transform": {
49-
// process *.vue files with jest-vue
50-
".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
49+
// process *.vue files with vue-jest
50+
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
5151
},
5252
"mapCoverage": true
5353
}
5454
}
5555
```
5656

57-
> **Note:** `jest-vue` currently does not support all the features of `vue-loader`, for example custom block support and style loading. In addition, some webpack-specific features such as code-splitting are not supported either. To use them, read the guide on [testing SFCs with Mocha + webpack](./testing-SFCs-with-mocha-webpack.md).
57+
> **Note:** `vue-jest` currently does not support all the features of `vue-loader`, for example custom block support and style loading. In addition, some webpack-specific features such as code-splitting are not supported either. To use them, read the guide on [testing SFCs with Mocha + webpack](./testing-SFCs-with-mocha-webpack.md).
5858
5959
## Handling webpack Aliases
6060

docs/ja/guides/choosing-a-test-runner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
ですが、テストランナを選択する際には、機能セット、パフォーマンス、および単一ファイルコンポーネント (SFC) の事前コンパイルのサポートなどを考慮すべきです。既存のライブラリを慎重に比較した上で、以下の2つのテストランナをお勧めします:
88

9-
- [Jest](https://facebook.github.io/jest/docs/en/getting-started.html#content) は最も充実したテストランナです。最小の設定が必要で、デフォルトで JSDOM を設定し、組み込みの検証を提供し、コマンドラインのユーザーエクスペリエンスが優れています。ただし、テストで SFC コンポーネントをインポートできるようにするには、プリプロセッサが必要です。最も一般的な SFC 機能を処理できる `jest-vue` プリプロセッサを作成しましたが、現在 `vue-loader` と 100% 同じ機能を持っていません。
9+
- [Jest](https://facebook.github.io/jest/docs/en/getting-started.html#content) は最も充実したテストランナです。最小の設定が必要で、デフォルトで JSDOM を設定し、組み込みの検証を提供し、コマンドラインのユーザーエクスペリエンスが優れています。ただし、テストで SFC コンポーネントをインポートできるようにするには、プリプロセッサが必要です。最も一般的な SFC 機能を処理できる `vue-jest` プリプロセッサを作成しましたが、現在 `vue-loader` と 100% 同じ機能を持っていません。
1010

1111
- [mocha-webpack](https://github.com/zinserjan/mocha-webpack) は webpack + Mocha のラッパですが、より合理的なインタフェースと watch モードを備えています。この設定のメリットは、webpack + `vue-loader` を使用して完全な SFC サポートを得ることができるということですが、より多くの設定を行う必要があります。
1212

@@ -29,7 +29,7 @@ require('jsdom-global')()
2929

3030
単一ファイルコンポーネントは、ノードまたはブラウザで実行する前に事前コンパイルが必要です。コンパイルを実行するには、Jest プリプロセッサを使用する方法と webpack を直接使用する方法が推奨されます。
3131

32-
`jest-vue` プリプロセッサは基本的な SFC 機能をサポートしていますが、現在 `vue-loader` でのみサポートされているスタイルブロックやカスタムブロックは扱いません。これらの機能やその他の Webpack 固有の設定に依存する場合は、webpack + `vue-loader` ベースの設定を使用する必要があります。
32+
`vue-jest` プリプロセッサは基本的な SFC 機能をサポートしていますが、現在 `vue-loader` でのみサポートされているスタイルブロックやカスタムブロックは扱いません。これらの機能やその他の Webpack 固有の設定に依存する場合は、webpack + `vue-loader` ベースの設定を使用する必要があります。
3333

3434
さまざまな設定については、次のガイドをお読みください:
3535
- [Jest による単一ファイルコンポーネントのテスト](./testing-SFCs-with-jest.md)

docs/ja/guides/testing-SFCs-with-jest.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ $ npm install --save-dev jest vue-test-utils
2727

2828
## Jest における単一ファイルコンポーネントの処理
2929

30-
Jest に `*.vue` ファイルの処理方法を教えるために、`jest-vue` プリプロセッサをインストールして設定する必要があります。:
30+
Jest に `*.vue` ファイルの処理方法を教えるために、`vue-jest` プリプロセッサをインストールして設定する必要があります。:
3131

3232
``` bash
33-
npm install --save-dev jest-vue
33+
npm install --save-dev vue-jest
3434
```
3535

3636
次に、`package.json``jest` ブロックを作成します:
@@ -46,15 +46,15 @@ npm install --save-dev jest-vue
4646
"vue"
4747
],
4848
"transform": {
49-
// jest-vue で *.vue ファイルを処理する
50-
".*\\.(vue)$": "<rootDir>/node_modules/jest-vue"
49+
// vue-jest で *.vue ファイルを処理する
50+
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest"
5151
},
5252
"mapCoverage": true
5353
}
5454
}
5555
```
5656

57-
> **注意:** `jest-vue` は現在、カスタムブロックのサポートやスタイルのロードなど、`vue-loader` のすべての機能をサポートしていません。さらに、コード分割などのWebpack固有の機能はサポートされていません。それらを使用するには、[Mocha + webpackによる単一ファイルコンポーネントのテスト](./testing-SFCs-with-mocha-webpack.md)のガイドをお読みください。
57+
> **注意:** `vue-jest` は現在、カスタムブロックのサポートやスタイルのロードなど、`vue-loader` のすべての機能をサポートしていません。さらに、コード分割などのWebpack固有の機能はサポートされていません。それらを使用するには、[Mocha + webpackによる単一ファイルコンポーネントのテスト](./testing-SFCs-with-mocha-webpack.md)のガイドをお読みください。
5858
5959
## Webpack エイリアスの処理
6060

0 commit comments

Comments
 (0)