You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme-fr.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -585,22 +585,22 @@ it("When updating site name, get successful confirmation", async () => {
585
585
586
586
<br/>
587
587
588
-
## ⚪ ️ 1.10 Don’t catch errors, expect them
588
+
## ⚪ ️ 1.10 Ne catch pas les erreurs, prevois les
589
589
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.
591
591
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.
593
593
<br/>
594
594
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é
0 commit comments