Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions docs/LANGS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* [English](en/)
* [Français](fr/)
* [日本語](ja/)
* [简体中文](zh-cn/)
* [Portuguese (Brazil)](pt-br/)
74 changes: 74 additions & 0 deletions docs/fr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# vue-test-utils

`vue-test-utils` est la bibliothèque officielle de tests unitaires pour Vue.js.

## Table of Contents

* [Guides](guides/README.md)
* [Commencer](guides/getting-started.md)
* [Astuces](guides/common-tips.md)
* [La souris, le clavier et les autres évènements DOM](guides/dom-events.md)
* [Choisir un lanceur de tests](guides/choosing-a-test-runner.md)
* [Tester des composants monofichiers avec Jest](guides/testing-SFCs-with-jest.md)
* [Tester des composants monofichiers avec Mocha et webpack](guides/testing-SFCs-with-mocha-webpack.md)
* [Utiliser avec Vue Router](guides/using-with-vue-router.md)
* [Utiliser avec Vuex](guides/using-with-vuex.md)
* [API](api/README.md)
* [mount](api/mount.md)
* [shallow](api/shallow.md)
* [Options de montage](api/options.md)
- [context](api/options.md#context)
- [slots](api/options.md#slots)
- [stubs](api/options.md#stubs)
- [mocks](api/options.md#mocks)
- [localVue](api/options.md#localvue)
- [attachToDocument](api/options.md#attachtodocument)
- [attrs](api/options.md#attrs)
- [listeners](api/options.md#listeners)
- [clone](api/options.md#clone)
* [Wrapper](api/wrapper/README.md)
* [contains](api/wrapper/contains.md)
* [emitted](api/wrapper/emitted.md)
* [emittedByOrder](api/wrapper/emittedByOrder.md)
* [find](api/wrapper/find.md)
* [findAll](api/wrapper/findAll.md)
* [hasAttribute](api/wrapper/hasAttribute.md)
* [hasClass](api/wrapper/hasClass.md)
* [hasProp](api/wrapper/hasProp.md)
* [hasStyle](api/wrapper/hasStyle.md)
* [html](api/wrapper/html.md)
* [is](api/wrapper/is.md)
* [isEmpty](api/wrapper/isEmpty.md)
* [isVueInstance](api/wrapper/isVueInstance.md)
* [name](api/wrapper/name.md)
* [setComputed](api/wrapper/setComputed.md)
* [setData](api/wrapper/setData.md)
* [setMethods](api/wrapper/setMethods.md)
* [setProps](api/wrapper/setProps.md)
* [text](api/wrapper/text.md)
* [trigger](api/wrapper/trigger.md)
* [update](api/wrapper/update.md)
* [destroy](api/wrapper/destroy.md)
* [WrapperArray](api/wrapper-array/README.md)
* [at](api/wrapper-array/at.md)
* [contains](api/wrapper-array/contains.md)
* [hasAttribute](api/wrapper-array/hasAttribute.md)
* [hasClass](api/wrapper-array/hasClass.md)
* [hasProp](api/wrapper-array/hasProp.md)
* [hasStyle](api/wrapper-array/hasStyle.md)
* [is](api/wrapper-array/is.md)
* [isEmpty](api/wrapper-array/isEmpty.md)
* [isVueInstance](api/wrapper-array/isVueInstance.md)
* [setComputed](api/wrapper-array/setComputed.md)
* [setData](api/wrapper-array/setData.md)
* [setMethods](api/wrapper-array/setMethods.md)
* [setProps](api/wrapper-array/setProps.md)
* [trigger](api/wrapper-array/trigger.md)
* [update](api/wrapper-array/update.md)
* [destroy](api/wrapper-array/destroy.md)
* [components](api/components/README.md)
* [TransitionStub](api/components/TransitionStub.md)
* [TransitionGroupStub](api/components/TransitionGroupStub.md)
* [Selecteurs](api/selectors.md)
* [createLocalVue](api/createLocalVue.md)
* [config](api/config.md)
70 changes: 70 additions & 0 deletions docs/fr/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
## Table of Contents
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je penseque ça serait bien d'avoir le fichier entier traduit


* [Guides](guides/README.md)
* [Commencer](guides/getting-started.md)
* [Astuces](guides/common-tips.md)
* [Mouse, Key and other DOM Events (EN)](guides/dom-events.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

* [Choisir un lanceur de tests](guides/choosing-a-test-runner.md)
* [Tester des composants monofichiers avec Jest](guides/testing-SFCs-with-jest.md)
* [Tester des composants monofichiers avec Mocha et webpack](guides/testing-SFCs-with-mocha-webpack.md)
* [Utiliser avec Vue Router](guides/using-with-vue-router.md)
* [Utiliser avec Vuex](guides/using-with-vuex.md)
* [API](api/README.md)
* [mount](api/mount.md)
* [shallow](api/shallow.md)
* [Options de montage](api/options.md)
- [context](api/options.md#context)
- [slots](api/options.md#slots)
- [stubs](api/options.md#stubs)
- [mocks](api/options.md#mocks)
- [localVue](api/options.md#localvue)
- [attachToDocument](api/options.md#attachtodocument)
- [attrs](api/options.md#attrs)
- [listeners](api/options.md#listeners)
- [clone](api/options.md#clone)
* [Wrapper](api/wrapper/README.md)
* [contains](api/wrapper/contains.md)
* [emitted](api/wrapper/emitted.md)
* [emittedByOrder](api/wrapper/emittedByOrder.md)
* [find](api/wrapper/find.md)
* [findAll](api/wrapper/findAll.md)
* [hasAttribute](api/wrapper/hasAttribute.md)
* [hasClass](api/wrapper/hasClass.md)
* [hasProp](api/wrapper/hasProp.md)
* [hasStyle](api/wrapper/hasStyle.md)
* [html](api/wrapper/html.md)
* [is](api/wrapper/is.md)
* [isEmpty](api/wrapper/isEmpty.md)
* [isVueInstance](api/wrapper/isVueInstance.md)
* [name](api/wrapper/name.md)
* [setComputed](api/wrapper/setComputed.md)
* [setData](api/wrapper/setData.md)
* [setMethods](api/wrapper/setMethods.md)
* [setProps](api/wrapper/setProps.md)
* [text](api/wrapper/text.md)
* [trigger](api/wrapper/trigger.md)
* [update](api/wrapper/update.md)
* [destroy](api/wrapper/destroy.md)
* [WrapperArray](api/wrapper-array/README.md)
* [at](api/wrapper-array/at.md)
* [contains](api/wrapper-array/contains.md)
* [hasAttribute](api/wrapper-array/hasAttribute.md)
* [hasClass](api/wrapper-array/hasClass.md)
* [hasProp](api/wrapper-array/hasProp.md)
* [hasStyle](api/wrapper-array/hasStyle.md)
* [is](api/wrapper-array/is.md)
* [isEmpty](api/wrapper-array/isEmpty.md)
* [isVueInstance](api/wrapper-array/isVueInstance.md)
* [setComputed](api/wrapper-array/setComputed.md)
* [setData](api/wrapper-array/setData.md)
* [setMethods](api/wrapper-array/setMethods.md)
* [setProps](api/wrapper-array/setProps.md)
* [trigger](api/wrapper-array/trigger.md)
* [update](api/wrapper-array/update.md)
* [destroy](api/wrapper-array/destroy.md)
* [components](api/components/README.md)
* [TransitionStub](api/components/TransitionStub.md)
* [TransitionGroupStub](api/components/TransitionGroupStub.md)
* [Selectors](api/selectors.md)
* [createLocalVue](api/createLocalVue.md)
* [config](api/config.md)
60 changes: 60 additions & 0 deletions docs/fr/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# API

* [mount (EN)](./mount.md)
* [shallow (EN)](./shallow.md)
* [Options de montage (EN)](./options.md)
- [context (EN)](./options.md#context)
- [slots (EN)](./options.md#slots)
- [stubs (EN)](./options.md#stubs)
- [mocks (EN)](./options.md#mocks)
- [localVue (EN)](./options.md#localvue)
- [attachToDocument (EN)](./options.md#attachtodocument)
- [attrs (EN)](./options.md#attrs)
- [listeners (EN)](./options.md#listeners)
- [clone (EN)](./options.md#clone)
* [Wrapper (EN)](./wrapper/README.md)
* [contains (EN)](./wrapper/contains.md)
* [emitted (EN)](./wrapper/emitted.md)
* [emittedByOrder (EN)](./wrapper/emittedByOrder.md)
* [find (EN)](./wrapper/find.md)
* [findAll (EN)](./wrapper/findAll.md)
* [hasAttribute (EN)](./wrapper/hasAttribute.md)
* [hasClass (EN)](./wrapper/hasClass.md)
* [hasProp (EN)](./wrapper/hasProp.md)
* [hasStyle (EN)](./wrapper/hasStyle.md)
* [html (EN)](./wrapper/html.md)
* [is (EN)](./wrapper/is.md)
* [isEmpty (EN)](./wrapper/isEmpty.md)
* [isVueInstance (EN)](./wrapper/isVueInstance.md)
* [name (EN)](./wrapper/name.md)
* [setComputed](./wrapper/setComputed.md)
* [setData](./wrapper/setData.md)
* [setMethods](./wrapper/setMethods.md)
* [setProps](./wrapper/setProps.md)
* [text](./wrapper/text.md)
* [trigger (EN)](./wrapper/trigger.md)
* [update (EN)](./wrapper/update.md)
* [destroy (EN)](./wrapper/destroy.md)
* [WrapperArray (EN)](./wrapper-array/README.md)
* [at (EN)](./wrapper-array/at.md)
* [contains (EN)](./wrapper-array/contains.md)
* [hasAttribute (EN)](./wrapper-array/hasAttribute.md)
* [hasClass (EN)](./wrapper-array/hasClass.md)
* [hasProp (EN)](./wrapper-array/hasProp.md)
* [hasStyle (EN)](./wrapper-array/hasStyle.md)
* [is (EN)](./wrapper-array/is.md)
* [isEmpty (EN)](./wrapper-array/isEmpty.md)
* [isVueInstance (EN)](./wrapper-array/isVueInstance.md)
* [setComputed (EN)](./wrapper-array/setComputed.md)
* [setData (EN)](./wrapper-array/setData.md)
* [setMethods (EN)](./wrapper-array/setMethods.md)
* [setProps (EN)](./wrapper-array/setProps.md)
* [trigger (EN)](./wrapper-array/trigger.md)
* [update (EN)](./wrapper-array/update.md)
* [destroy (EN)](./wrapper-array/destroy.md)
* [components](./components/README.md)
* [TransitionStub](./components/TransitionStub.md)
* [TransitionGroupStub](./components/TransitionGroupStub.md)
* [createLocalVue (EN)](./createLocalVue.md)
* [Selecteurs (EN)](./selectors.md)
* [config (EN)](./config.md)
5 changes: 5 additions & 0 deletions docs/fr/api/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Components

vue-test-utils includes utility components you can use to stub components.

[TransitionStub](./TransitionStub.md) and [TransitionGroupStub](./TransitionGroupStub.md) are used to stub `transition` and `transition-group` components by default. You can edit the stubs by editing the config.
31 changes: 31 additions & 0 deletions docs/fr/api/components/TransitionGroupStub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# TransitionGroupStub

A component to stub the `transition-group` wrapper component. Instead of performing transitions asynchronously, it returns the child components synchronously.

This is set to stub all `transition-group` components by default in the `vue-test-utils` config. To use the built-in `transition-group` wrapper component set `config.stubs['transition-group']` to false:

```js
import VueTestUtils from 'vue-test-utils'

VueTestUtils.config.stubs['transition-group'] = false
```

To reset it to stub transition components:

```js
import VueTestUtils, { TransitionGroupStub } from 'vue-test-utils'

VueTestUtils.config.stubs['transition-group'] = TransitionGroupStub
```

To set it as a stub in mounting options:

```js
import { mount, TransitionGroupStub } from 'vue-test-utils'

mount(Component, {
stubs: {
'transition-group': TransitionGroupStub
}
})
```
30 changes: 30 additions & 0 deletions docs/fr/api/components/TransitionStub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# TransitionStub

A component to stub the `transition` wrapper component. Instead of performing transitions asynchronously, it returns the child component synchronously.

This is set to stub all `transition` components by default in the vue-test-utils config. To use the built-in `transition` wrapper component set `config.stubs.transition` to false:

```js
import VueTestUtils from 'vue-test-utils'

VueTestUtils.config.stubs.transition = false
```

To reset it to stub transition components:
```js
import VueTestUtils, { TransitionStub } from 'vue-test-utils'

VueTestUtils.config.stubs.transition = TransitionStub
```

To set it as a stub in mounting options:

```js
import { mount, TransitionStub } from 'vue-test-utils'

mount(Component, {
stubs: {
transition: TransitionStub
}
})
```
25 changes: 25 additions & 0 deletions docs/fr/api/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Config

vue-test-utils includes a config object to defined options used by vue-test-utils.

## `vue-test-utils` Config Options

### `stubs`

- type: `Object`
- default: `{
transition: TransitionStub,
'transition-group': TransitionGroupStub
}`

Stubs to use in components. These are overwritten by `stubs` passed in the mounting options.

When passing `stubs` as an array in the mounting options, `config.stubs` are converted to an array, and will stub components with a basic component that returns a div.

Example:

```js
import VueTestUtils from 'vue-test-utils'

VueTestUtils.config.stubs['my-compomnent'] = '<div />'
```
28 changes: 28 additions & 0 deletions docs/fr/api/createLocalVue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# `createLocalVue()`

- **Returns:**
- `{Component}`

- **Usage:**

<p><strong>⚠Cette page est actuellement en cours de traduction française. Vous pouvez repasser plus tard ou <a href="https://github.com/vuejs-fr/vue-test-utils" target="_blank">participer à la traduction</a> de celle-ci dès maintenant !</strong></p><p>`createLocalVue` returns a Vue class for you to add components, mixins and install plugins without polluting the global Vue class.</p>

Use it with `options.localVue`:

```js
import { createLocalVue, shallow } from 'vue-test-utils'
import { expect } from 'chai'
import Foo from './Foo.vue'

const localVue = createLocalVue()
const wrapper = shallow(Foo, {
localVue,
mocks: { foo: true }
})
expect(wrapper.vm.foo).toBe(true)

const freshWrapper = shallow(Foo)
expect(freshWrapper.vm.foo).toBe(false)
```

- **See also:** [Common Tips](../guides/common-tips.md#applying-global-plugins-and-mixins)
Loading