Skip to content

Commit cd0c49a

Browse files
authored
Merge pull request goldbergyoni#6 from NoriSte/patch-4
Fix Sinon link
2 parents aca7459 + 3523577 commit cd0c49a

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

readme.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ test('movie title appears', async () => {
12811281

12821282
## ⚪ ️ 3.6 Stub flakky and slow resources like backend APIs
12831283

1284-
:white_check_mark: **Do:** When coding your mainstream tests (not E2E tests), avoid involving any resource that is beyond your responsibility and control like backend API and use stubs instead (i.e. test double). Practically, instead of real network calls to APIs, use some test double library (like [Sinon]https://sinonjs.org/, [Test doubles](https://www.npmjs.com/package/testdouble), etc) for stubbing the API response. The main benefit is preventing flakiness - testing or staging APIs by definition are not highly stable and from time to time will fail your tests although YOUR component behaves just fine (production env was not meant for testing and it usually throttles requests). Doing this will allow simulating various API behavior that should drive your component behavior as when no data was found or the case when API throws an error. Last but not least, network calls will greatly slow down the tests
1284+
:white_check_mark: **Do:** When coding your mainstream tests (not E2E tests), avoid involving any resource that is beyond your responsibility and control like backend API and use stubs instead (i.e. test double). Practically, instead of real network calls to APIs, use some test double library (like [Sinon](https://sinonjs.org/), [Test doubles](https://www.npmjs.com/package/testdouble), etc) for stubbing the API response. The main benefit is preventing flakiness - testing or staging APIs by definition are not highly stable and from time to time will fail your tests although YOUR component behaves just fine (production env was not meant for testing and it usually throttles requests). Doing this will allow simulating various API behavior that should drive your component behavior as when no data was found or the case when API throws an error. Last but not least, network calls will greatly slow down the tests
12851285

12861286
<br/>
12871287

@@ -2021,18 +2021,4 @@ Took care to revise, improve, lint and polish all the texts
20212021

20222022
**Role:** Concept, design and great advice
20232023

2024-
**About:** A savvy frontend developer, CSS expert and emojis freak
2025-
2026-
2027-
2028-
2029-
2030-
<!--stackedit_data:
2031-
eyJoaXN0b3J5IjpbMTY0NDA1ODIwOSwxODIzNzc5OTIwLC0xMj
2032-
I1NDYyNDIyLC02MjcyMjAwMSwxMTMwMjY3NDQ2LDE1ODU4NjU2
2033-
MzIsMjk4MDczNzAzLDU4MzU0NjQ2OCwtMzQ4Njk5MjE3LDc5ND
2034-
gwOTQ2NywxNTk3MjQwNzc1LDIxMDM0MzAxNjYsLTM3NTY2Mzg0
2035-
LC0xMjg2NTMxNjAwLC0yOTc1MDI2MjMsNDM1MTk1ODgwLDE3Nj
2036-
U5NjcxMzAsNzk0ODg4NTE3LC0xODAwNTU1MDA2LDkzNTEyNDg3
2037-
OV19
2038-
-->
2024+
**About:** A savvy frontend developer, CSS expert and emojis freak

0 commit comments

Comments
 (0)