-
Notifications
You must be signed in to change notification settings - Fork 2
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
Guide: testing-SFCs-with-mocha-webpack.md #4
Guide: testing-SFCs-with-mocha-webpack.md #4
Conversation
@@ -27,19 +27,19 @@ Next we need to define a test script in our `package.json`. | |||
} | |||
``` | |||
|
|||
A few things to note here: | |||
Quelques éléments importants à notés : |
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.
à noter
@@ -51,9 +51,9 @@ module.exports = { | |||
} | |||
``` | |||
|
|||
#### Source Maps | |||
#### Carte des sources * TODO : PAS SUR ICI * |
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 demandé ici si on doit traduire oui ou non source maps
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.
Je laisse comme ça pour le moment
|
||
[Chai](http://chaijs.com/) is a popular assertion library that is commonly used alongside Mocha. You may also want to check out [Sinon](http://sinonjs.org/) for creating spies and stubs. | ||
[Chai](http://chaijs.com/) est une bibliothèque populaire qui est généralement utiliser avec Mocha. Vous pouvez aussi jeter un coup d'œil à [Sinon](http://sinonjs.org/) pour créer des espions et des fonctions avec un comportement pré-programmé (stubs). |
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.
généralement utilisée
|
||
Create a file in `src` named `Counter.vue`: | ||
Créez dans le dossier `src` un fichier nommé `Compteur.vue`: | ||
|
||
``` html | ||
<template> | ||
<div> | ||
{{ count }} |
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.
{{ compteur }}
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.
Quelques changement et proposition de traduction
@@ -1,22 +1,22 @@ | |||
# Testing Single File Components with Mocha + webpack | |||
# Tester des composants monofichiers avec Mocha + Webpack |
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.
webpack
|
||
> An example project for this setup is available on [GitHub](https://github.com/vuejs/vue-test-utils-mocha-webpack-example). | ||
> Un projet exemple pour cette installation est disponible sur [GitHub](https://github.com/vuejs/vue-test-utils-mocha-webpack-example). |
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.
Un exemple de projet
|
||
We will assume you are starting with a setup that already has webpack, vue-loader and Babel properly configured - e.g. the `webpack-simple` template scaffolded by `vue-cli`. | ||
On va supposer que vous commencez avec une installation qui a déjà webpack, vue-loader et Babel de correctement configurés (cf. le template `webpack-simple` via `vue-cli`). |
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 » est en trop ici
|
||
- The final argument is a glob for the test files to be included in the test bundle. | ||
- Le dernier paramètre est un glob pour indiquer les fichiers de tests à inclure dans le paquet. |
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 remplace tout les bundle par paquetage (avec les mot de la famille, empaquetage, désempaquetage, empaqueter, etc.). On garde plutôt le terme paquet pour « npm est un gestionnaire de paquet »
|
||
#### Externalizing NPM Dependencies | ||
#### Externaliser les dépendances NPM |
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.
npm, nom de produit
|
||
``` js | ||
require('jsdom-global')() | ||
``` | ||
|
||
This adds a browser environment to node, so that `vue-test-utils` can run correctly. | ||
Cela ajoute un environnement de navigateur dans node afin que `vue-test-utils` fonctionne correctement. |
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.
Node.js
|
||
[Chai](http://chaijs.com/) is a popular assertion library that is commonly used alongside Mocha. You may also want to check out [Sinon](http://sinonjs.org/) for creating spies and stubs. | ||
[Chai](http://chaijs.com/) est une bibliothèque populaire qui est généralement utilisée avec Mocha. Vous pouvez aussi jeter un coup d'œil à [Sinon](http://sinonjs.org/) pour créer des espions et des fonctions avec un comportement pré-programmé (stubs). |
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.
préprogrammé (« stubs »).
|
||
One thing to note is that if you are using Node 6+, which already supports the majority of ES2015 features, you can configure a separate Babel [env option](https://babeljs.io/docs/usage/babelrc/#env-option) that only transpiles features that are not already supported in the Node version you are using (e.g. `stage-2` or flow syntax support, etc.) | ||
Une autre chose à noter est que si vous utilisez une version de Node >= 6, qui supporte déjà une majorité des fonctionnalités d'ES2015, vous pouvez configurer séparément un autre Babel [env option](https://babeljs.io/docs/usage/babelrc/#env-option) qui va uniquement transpiler les fonctionnalités non supportées dans la version de Node que vous utilisez (c.-à-d. `stage-2` ou le support de la syntaxe flow, etc.). |
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.
Node >= 6 ---> Node.js 6+
C'est la nomonclature qu'on utlise à travers toutes les docs Vue. Si tu ne vois pas ça quelque part, tu peux PR 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.
version de Node.js
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.
Si tu mets
`stage-2`
je te laisse mettre
`stage-x`
sur l'un des précédents fichiers déjà validé
{{ count }} | ||
<button @click="increment">Increment</button> | ||
{{ counter }} | ||
<button @click="incrementer">Incrementer</button> |
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.
<button @click="increment">Incrementer</button>
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.
Laisse count car ça nous fera moins de conflits à résoudre en cas de changement de code. On traduit texte, label et valeur de chaine de caractère. « increment » étant une fonction, on ne le traduit pas.
} | ||
}, | ||
|
||
methods: { | ||
increment () { | ||
this.count++ | ||
incrementer () { |
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.
increment
Traduction du fichier testing-SFCs-with-mocha-webpack.md
Je n'ai fait qu'une seule relecture, ça risque d'être un peu brut et pas forcement trop agréable à lire. A voir :)
Ligne 54 je n'ai pas trop su comment traduire ça (Source maps).