Skip to content

[docs] createLocalVue should be a named import #241

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

Merged
merged 1 commit into from
Dec 8, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Some of the components may rely on features injected by a global plugin or mixin
If you are writing tests for components in a specific app, you can setup the same global plugins and mixins once in the entry of your tests. But in some cases, for example testing a generic component suite that may get shared across different apps, it's better to test your components in a more isolated setup, without polluting the global `Vue` constructor. We can use the [`createLocalVue`](../api/createLocalVue.md) method to achieve that:

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// create an extended `Vue` constructor
const localVue = createLocalVue()
Expand Down
2 changes: 1 addition & 1 deletion docs/fr/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Des composants pourraient se fier à des fonctionnalités injectées par un plug
Si vous écrivez des tests pour des composants dans une application spécifique, vous pouvez mettre en place les mêmes plugins globaux et mixins en une seule fois dans vos tests. Dans certains cas, comme tester un composant générique utilisé par des applications différentes, il est favorable de tester ces composants dans une installation plus isolée, sans avoir à polluer le constructeur global `Vue`. On peut utiliser la méthode [`createLocalVue`](../api/createLocalVue.md) pour faire cela :

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// créer un constructeur local de `Vue`
const localVue = createLocalVue()
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mount(Component, {
特定のアプリケーションでコンポーネントのテストを作成している場合は、同じグローバルプラグインとミックスインをテストのエントリに設定できます。しかし、異なるアプリケーション間で共有される可能性のあるジェネリックコンポーネントスイートをテストする場合など、グローバルな `Vue` コンストラクタを汚染することなく、より孤立した設定でコンポーネントをテストする方が良い場合もあります。[createLocalVue](../api/createLocalVue.md) メソッドを使用すると、次のことができます:

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// 拡張された Vue コンストラクタを作成する
const localVue = createLocalVue()
Expand Down
2 changes: 1 addition & 1 deletion docs/kr/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mount(Component, {
특정 앱의 컴포넌트에 대한 테스트를 작성하는 경우 동일한 글로벌 플러그인과 믹스인을 테스트 항목에 한번만 설정할 수 있습니다. 그러나 일부 앱에서 공유할 수 있는 일반적인 컴포넌트들을 테스트하는 경우에는 글로벌 `Vue` 생성자를 오염시키지 않고 격리시켜 컴포넌트를 테스트하는 것이 좋습니다. [createLocalVue](../api/createLocalVue.md) 메소드를 사용해 다음과 같이 할 수 있습니다.

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// 확장된 Vue 생성자를 만듭니다.
const localVue = createLocalVue()
Expand Down
2 changes: 1 addition & 1 deletion docs/pt-br/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Alguns dos seus componentes podem ter características injetadas por um plugin o
Se você está escrevendo testes para componentes de uma aplicação específica, você pode configurar os plugins e mixins globais uma vez na entrada dos seus testes. Mas, em alguns casos, por exemplo, testando um pacote de componentes genéricos que podem ser compartilhados em diferentes aplicações, será melhor testar seus componentes com uma configuração mais isolada, sem popular o construtor global do Vue. Nós podemos usar o método [createLocalVue](../api/createLocalVue.md) para conseguir isso:

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// criando um construtor ampliado do Vue
const localVue = createLocalVue()
Expand Down
2 changes: 1 addition & 1 deletion docs/ru/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mount(Component, {
Если вы пишете тесты для компонентов определённого приложения, вы можете настроить одни и те же глобальные плагины и примеси один раз перед началом ваших тестов. Но в некоторых случаях, например при тестировании набора общих компонентов, которые могут использоваться в разных приложениях, гораздо лучше протестировать ваши компоненты в более изолированной конфигурации, без загрязнения глобального конструктора `Vue`. Мы можем использовать метод [`createLocalVue`](../api/createLocalVue.md) для достижения этого:

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// создаём расширенный конструктор `Vue`
const localVue = createLocalVue()
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-cn/guides/common-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mount(Component, {
如果你在为一个特定的应用撰写组件,你可以在你的测试入口处一次性设置相同的全局插件和混入。但是有些情况下,比如测试一个可能会跨越不同应用共享的普通的组件套件的时候,最好还是在一个更加隔离的设置中测试你的组件,不对全局的 `Vue` 构造函数注入任何东西。我们可以使用 [`createLocalVue`](../api/createLocalVue.md) 方法来存档它们:

``` js
import createLocalVue from 'vue-test-utils'
import { createLocalVue } from 'vue-test-utils'

// 创建一个扩展的 `Vue` 构造函数
const localVue = createLocalVue()
Expand Down