Skip to content

Commit 21aace8

Browse files
committed
Translation of 3-parts-in-name.md
1 parent b7638c7 commit 21aace8

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
1-
# Include 3 parts in each test name
1+
# Incluez 3 parties dans chaque nom de test
22

33
<br/><br/>
44

5-
### One Paragraph Explainer
5+
### Un paragraphe d'explication
66

7-
A test report should tell whether the current application revision satisfies the requirements for the people who are not necessarily familiar with the code: the tester, the DevOps engineer who is deploying and the future you two years from now. This can be achieved best if the tests speak at the requirements level and include 3 parts:
7+
Un rapport de test devrait indiquer si la révision actuelle de l'application satisfait aux exigences des personnes qui ne sont pas nécessairement familières avec le code : le testeur, l'ingénieur DevOps qui déploie et vous dans deux ans. Cela peut être mieux réalisé si les tests décrivent le niveau d'exigence et comprennent 3 parties :
88

9-
(1) What is being tested? For example, the ProductsService.addNewProduct method
9+
(1) Qu'est-ce qui est testé ? Par exemple, la méthode `ProductsService.addNewProduct`
1010

11-
(2) Under what circumstances and scenario? For example, no price is passed to the method
11+
(2) Dans quelles circonstances et dans quel scénario ? Par exemple, aucun prix n'est transmis à la méthode
1212

13-
(3) What is the expected result? For example, the new product is not approved
13+
(3) Quel est le résultat attendu ? Par exemple, le nouveau produit n'est pas approuvé<br/><br/>
1414

15-
<br/><br/>
16-
17-
### Code example: a test name that incluces 3 parts
15+
### Exemple de code : un nom de test qui comprend 3 parties
1816
```javascript
19-
//1. unit under test
20-
describe('Products Service', () => {
21-
describe('Add new product', () => {
22-
//2. scenario and 3. expectation
23-
it('When no price is specified, then the product status is pending approval', () => {
17+
//1. unité testée
18+
describe('Service Produits', () => {
19+
describe('Ajoute un nouveau produit', () => {
20+
//2. scénario et 3. attente
21+
it('Quand aucun prix n\'est spécifié, alors le statut du produit est en attente d\'approbation', () => {
2422
const newProduct = new ProductService().add(...);
25-
expect(newProduct.status).to.equal('pendingApproval');
23+
expect(newProduct.status).to.equal('validationEnAttente');
2624
});
2725
});
2826
});
2927
```
3028

3129
<br/><br/>
3230

33-
### Code Example – Anti Pattern: one must read the entire test code to understand the intent
31+
### Contre exemple de code : il faut lire l'intégralité du code du test pour comprendre l'intention
3432
```javascript
35-
describe('Products Service', () => {
36-
describe('Add new product', () => {
37-
it('Should return the right status', () => {
38-
//hmm, what is this test checking? what are the scenario and expectation?
33+
describe('Service Produits', () => {
34+
describe('Ajoute un nouveau produit', () => {
35+
it('Devrait retourner le bon statut', () => {
36+
//hmm, quelle est cette vérification de test ? quels sont le scénario et les attentes ?
3937
const newProduct = new ProductService().add(...);
40-
expect(newProduct.status).to.equal('pendingApproval');
38+
expect(newProduct.status).to.equal('validationEnAttente');
4139
});
4240
});
4341
});
4442
```
4543

4644
<br/><br/>
4745

48-
### "Doing It Right Example: The test report resembles the requirements document"
46+
### « Un exemple à suivre : le rapport de test ressemble au document des spécifications »
4947

50-
[From the blog "30 Node.js testing best practices" by Yoni Goldberg](https://medium.com/@me_37286/yoni-goldberg-javascript-nodejs-testing-best-practices-2b98924c9347)
48+
[Extrait du blog de « 30 bonnes pratiques de test avec Node.js » par Yoni Goldberg](https://medium.com/@me_37286/yoni-goldberg-javascript-nodejs-testing-best-practices-2b98924c9347)
5149

52-
![A test report example](https://github.com/i0natan/nodebestpractices/blob/master/assets/images/test-report-like-requirements.jpeg "A test report example")
50+
![Un exemple de rapport de test](https://github.com/i0natan/nodebestpractices/blob/master/assets/images/test-report-like-requirements.jpeg "Un exemple de rapport de test")
5351

5452
<br/><br/>

0 commit comments

Comments
 (0)