Skip to content

Commit 437179d

Browse files
author
mel-mouk
committed
Translate 1.10
1 parent 61c9ee6 commit 437179d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

readme-fr.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -585,22 +585,22 @@ it("When updating site name, get successful confirmation", async () => {
585585

586586
<br/>
587587

588-
## ⚪ ️ 1.10 Don’t catch errors, expect them
588+
## ⚪ ️ 1.10 Ne catch pas les erreurs, prevois les
589589

590-
:white_check_mark: **Do:** When trying to assert that some input triggers an error, it might look right to use try-catch-finally and asserts that the catch clause was entered. The result is an awkward and verbose test case (example below) that hides the simple test intent and the result expectations
590+
:white_check_mark: **À faire:** Lorsqu'on essaye de detecter que certaines entrées déclenchent une erreur, il peut sembler être une bonne idée d'utiliser try-catch-finally et de vérifier qu'on est passé dans le catch. Le résultat est un test étrange et verbeux (exemple plus bas) qui cache l'intention simple du test et le résultat attendu.
591591

592-
A more elegant alternative is the using the one-line dedicated Chai assertion: expect(method).to.throw (or in Jest: expect(method).toThrow()). It’s absolutely mandatory to also ensure the exception contains a property that tells the error type, otherwise given just a generic error the application won’t be able to do much rather than show a disappointing message to the user
592+
Une alternative plus élégante est d'utiliser l'assertion Chai dédiée : expect(method).to.throw (ou en Jest: expect(method).toThrow()). Il est également obligatoire de vérifier que l'exception contient une propriété qui indique le type d'erreur, sinon, en recevant un message d'erreur générique, l'application ne sera pas capable de faire beaucoup plus que de montrer un message décevant à l'utilisateur.
593593
<br/>
594594

595-
**Otherwise:** It will be challenging to infer from the test reports (e.g. CI reports) what went wrong
595+
**Autrement:** Il sera compliqué de déduire du rapport de test ce qui s'est mal passé
596596

597597
<br/>
598598

599-
<details><summary>✏ <b>Code Examples</b></summary>
599+
<details><summary>✏ <b>Exemple de code</b></summary>
600600

601601
<br/>
602602

603-
### :thumbsdown: Anti-pattern Example: A long test case that tries to assert the existence of error with try-catch
603+
### :thumbsdown: Exemple d'anti pattern: Un long test qui essaye de vérifier la présence d'une erreur avec try-catch
604604

605605
![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg "Examples with Mocha")
606606

@@ -621,7 +621,7 @@ it("When no product name, it throws error 400", async () => {
621621

622622
<br/>
623623

624-
### :clap: Doing It Right Example: A human-readable expectation that could be understood easily, maybe even by QA or technical PM
624+
### :clap: Bien faire les choses, exemple: Un attente lisible qui peut être comprise simplement, peut être même par un QA ou PM technique
625625

626626
```javascript
627627
it("When no product name, it throws error 400", async () => {

0 commit comments

Comments
 (0)