Skip to content

Traduction de unit-testing-vue-components.md #124

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 6 commits into from
Jun 10, 2018

Conversation

elevatebart
Copy link

No description provided.

@elevatebart
Copy link
Author

Copy link

@forresst forresst left a comment

Choose a reason for hiding this comment

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

J'ai commencé la relecture, bravo pour ton travail.

Une erreur assez courante, tu ne met pas un espace avant ":", en français il y a toujours un espace avant le ":". Merci de faire le nécessaire. (C'est aussi le cas pour les "?", "!".


<p>Cette page est en cours de traduction. Pour nous aider, vous pouvez participer sur <a href="https://github.com/vuejs-fr/vuejs.org" target="_blank">le dépôt GitHub dédié de Vuejs-FR</a>.</p><p>Unit testing is a fundamental part of software development. Unit tests execute the smallest units of code in isolation, in order to increase ease of adding new features and track down bugs. Vue's [single-file components](../guide/single-file-components.html) make it straight forward to write unit tests for components in isolation. This lets you develop new features with confidence you are not breaking existing ones, and helps other developers understand what your component does.</p>
<p>Les tests unitaires sont une étape fondamentale du développement de logiciel. Ces tests permettent d'exécuter chaque unité de code isolée du reste du logiciel. Ils facilitent l'ajout de nouvelles fonctionnalités, la détection et la réparation de bugs. Les [composants monofichiers](../guide/single-file-components.html) de Vue rendent ce processus de test relativement facile. Tester notre code nous permettra d'ajouter des fonctionnalités sans risquer de casser l'existant. Nous pourrons en plus mieux expliquer ce que le composant est censé faire.</p>
Copy link

Choose a reason for hiding this comment

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

réparation => correction

c'est un avis personnel, pas une obligation

Tester notre code, nous permettra d'ajouter des fonctionnalités sans risquer de casser l'existant.

J'ajouterais bien une virgule après "Tester notre code"

Nous pourrons en plus mieux expliquer ce que le composant est censé faire aux autres développeurs.

Merci d'ajouter "aux autres développeurs" pour mieux coller à l'originale

Copy link
Author

Choose a reason for hiding this comment

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

Expliquer aux autres développeurs ce que le composant est censé faire


This simple example tests whether some text is rendered:
Cet exemple simple vérifie qu'un texte est affiché:
Copy link

Choose a reason for hiding this comment

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

affiché => rendu

@@ -35,7 +35,7 @@ export default {
computed: {
error () {
return this.username.trim().length < 7
? 'Please enter a longer username'
? 'Entrez un nom plus long SVP'
Copy link

Choose a reason for hiding this comment

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

Entrez un nom plus long SVP => Veuillez entrez un nom plus long

@@ -66,52 +66,52 @@ test('Foo', () => {
})
```

The above code snippet shows how to test whether an error message is rendered based on the length of the username. It demonstrates the general idea of unit testing Vue components: render the component, and assert that the markup matches the state of the component.
Le code ci-dessus montre comment tester l'apparition d'un message d'erreur si le username n'est pas assez long. Il nous donne une idée de ce en quoi consistent les tests unitaires de composants VueJs: On render le composant, on lui fournit des données, puis on vérifie que le rendu correspond au données.
Copy link

Choose a reason for hiding this comment

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

Il nous donne une idée générale sur de ce en quoi consistent les tests unitaires de composants VueJs des composants de Vue :

ne pas oublier un espace avant le ":"

Copy link

Choose a reason for hiding this comment

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

On render le composant, on lui fournit des données, puis on vérifie que le rendu correspond au données. => Nous rendons le composant, nous lui fournissons des données, puis nous vérifions que le rendu correspond aux données.


## Why test?
## Pourquoi tester?
Copy link

Choose a reason for hiding this comment

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

Ajoute un espace avant "?" => Pourquoi tester ?


Unit tests should be:
Un bon test unitaire se doit d'être:

Choose a reason for hiding this comment

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

Ajoute un espace avant ":" => Un bon test unitaire se doit d'être :

- Fast to run
- Easy to understand
- Only test a _single unit of work_
- Court à l'exécution

Choose a reason for hiding this comment

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

Court => Rapide

- Only test a _single unit of work_
- Court à l'exécution
- Facile à comprendre
- Tester un seul comportement à la fois

Choose a reason for hiding this comment

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

Tester un seul comportement à la fois => Tester un _seul comportement à la fois_

il faut ajouter les "_" pour garder la même mise en forme


Let's continue building on the previous example, while introducing the idea of a <a href="https://en.wikipedia.org/wiki/Factory_(object-oriented_programming)">factory function</a> to make our test more compact and readable. The component should:
Reprenons l'exemple précédent, et ajoutons y le concept de <a href="https://en.wikipedia.org/wiki/Factory_(object-oriented_programming)">factory function</a> pour rendre nos tests plus compacts et plus clairs. Le composant devra donc:

Choose a reason for hiding this comment

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

compacts => concis

Choose a reason for hiding this comment

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

Ajoute un espace avant ":" => Le composant devra donc :

- prompt the user to enter their username
- display an error if the entered username is less than seven letters
- Afficher un message 'Bienvenue sur le tutoriel VueJs'.
- Demander a l'utilisateur son username

Choose a reason for hiding this comment

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

a => à

@MachinisteWeb MachinisteWeb changed the title Traduction du tutoriel des tests unitaires. Traduction de unit-testing-vue-components.md Apr 16, 2018
@elevatebart
Copy link
Author

Salut @forrest j'ai mis a jour le site de preview netlify si tu veux jeter un oeuil.

@MachinisteWeb
Copy link
Member

Est ce que cette PR est prête ? Je vois que @forresst la bloque toujours ?

@elevatebart
Copy link
Author

je crois j'ai oublie un "s" à @forresst ce qui expliquerait qu'il n'ait pas repondu.

Copy link

@forresst forresst left a comment

Choose a reason for hiding this comment

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

J'ai des remarques qui n'ont pas été corrigées


Automated testing allows large teams of developers to maintain complex codebases.
Dans les équipes ou les développeurs sont nombreux, les tests automatiques permettent de maintenir une codebase volumineuse à moindre effort.

Choose a reason for hiding this comment

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

C'est toujours à modifier


[Vue Test Utils](https://github.com/vuejs/vue-test-utils) is the official library for unit testing Vue components. The [vue-cli](https://github.com/vuejs/vue-cli) `webpack` template comes with either Karma or Jest, both well supported test runners, and there are some [guides](https://vue-test-utils.vuejs.org/en/guides/) in the Vue Test Utils documentation.
Le package officiel pour tester les composant Vue est [Vue Test Utils](https://github.com/vuejs/vue-test-utils). Le template `webpack` pour [vue-cli](https://github.com/vuejs/vue-cli) contient soit Karma soit Jest. Ces deux test runners sont très bien supportés par VueJs. On peut trouver quelques [guides](https://vue-test-utils.vuejs.org/fr/guides/) dans la documentation des Vue Test Utils.

Choose a reason for hiding this comment

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

composant au pluriel


[Vue Test Utils](https://github.com/vuejs/vue-test-utils) is the official library for unit testing Vue components. The [vue-cli](https://github.com/vuejs/vue-cli) `webpack` template comes with either Karma or Jest, both well supported test runners, and there are some [guides](https://vue-test-utils.vuejs.org/en/guides/) in the Vue Test Utils documentation.
Le package officiel pour tester les composant Vue est [Vue Test Utils](https://github.com/vuejs/vue-test-utils). Le template `webpack` pour [vue-cli](https://github.com/vuejs/vue-cli) contient soit Karma soit Jest. Ces deux test runners sont très bien supportés par VueJs. On peut trouver quelques [guides](https://vue-test-utils.vuejs.org/fr/guides/) dans la documentation des Vue Test Utils.

Choose a reason for hiding this comment

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

de Vue Test Utils

@elevatebart
Copy link
Author

Salut @forresst, mes modification suivant tes recomendations.

@MachinisteWeb
Copy link
Member

Je vais valider les deux PR, s'il reste des choses à ajuster, on refera une PR ultérieurement. Merci infiniement pour ton travail et ta patience @elevatebart !

@MachinisteWeb MachinisteWeb merged commit 0957015 into vuejs-fr:master Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants