-
Notifications
You must be signed in to change notification settings - Fork 103
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
Traduction de unit-testing-vue-components.md
#124
Conversation
petit plus periglioni |
There was a problem hiding this 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> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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é: |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 ":"
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compacts => concis
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a => à
unit-testing-vue-components.md
Salut @forrest j'ai mis a jour le site de preview netlify si tu veux jeter un oeuil. |
Est ce que cette PR est prête ? Je vois que @forresst la bloque toujours ? |
je crois j'ai oublie un "s" à @forresst ce qui expliquerait qu'il n'ait pas repondu. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
de Vue Test Utils
Salut @forresst, mes modification suivant tes recomendations. |
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 ! |
No description provided.