Skip to content

Commit 8be1cdd

Browse files
committed
fixes
1 parent 243fb90 commit 8be1cdd

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

readme.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ describe('Products Service', function() {
169169

170170
![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg
171171
"Examples with Jest") ![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg
172-
"Examples with Jest")
172+
"Examples with Mocha")
173173

174174
```javascript
175175
describe('Customer classifier', () => {
@@ -344,7 +344,7 @@ For example, if you want to test that your app behaves reasonably when the payme
344344

345345
### :thumbsdown: Anti-pattern example: Mocks focus on the internals
346346
![](https://img.shields.io/badge/🔧%20Example%20using%20Sinon-blue.svg
347-
"Examples with Mocha & Chai")
347+
"Examples with Sinon")
348348
```javascript
349349
it("When a valid product is about to be deleted, ensure data access DAL was called once, with the right product and right config", async () => {
350350
//Assume we already added a product
@@ -566,7 +566,7 @@ expect(menu).toMatchInlineSnapshot(`
566566
### :thumbsdown: Anti Pattern Example: tests are not independent and rely on some global hook to feed global DB data
567567

568568
![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg
569-
"Examples with Jest")
569+
"Examples with Mocha")
570570

571571
```javascript
572572
before(() => {
@@ -628,7 +628,7 @@ A more elegant alternative is the using the one-line dedicated Chai assertion: e
628628
### :thumbsdown: Anti-pattern Example: A long test case that tries to assert the existence of error with try-catch
629629

630630
![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg
631-
"Examples with Jest")
631+
"Examples with Mocha")
632632

633633
```javascript
634634
it("When no product name, it throws error 400", async() => {
@@ -776,7 +776,7 @@ Component tests focus on the Microservice ‘unit’, they work against the API,
776776
### :clap: Doing It Right Example: Supertest allows approaching Express API in-process (fast and cover many layers)
777777

778778
![](https://img.shields.io/badge/🔧%20Example%20using%20Mocha-blue.svg
779-
"Examples with Jest")
779+
"Examples with Mocha")
780780

781781
![alt text](assets/bp-13-component-test-yoni-goldberg.png " [Supertest](https://www.npmjs.com/package/supertest) allows approaching Express API in-process (fast and cover many layers)")
782782

@@ -1201,8 +1201,9 @@ test('Shallow/mocked approach: When clicked to show filters, filters are display
12011201

12021202
### :clap: Doing It Right Example: E2E API that resolves only when the async operations is done (Cypress)
12031203

1204-
![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg
1205-
"Examples with React") ![](https://img.shields.io/badge/🔧%20Example%20using%20React%20Testing%20Library-blue.svg
1204+
![](https://img.shields.io/badge/🔨%20Example%20using%20Cypress-blue.svg
1205+
"Using Cypress to illustrate the idea")
1206+
![](https://img.shields.io/badge/🔧%20Example%20using%20React%20Testing%20Library-blue.svg
12061207
"Examples with react-testing-library")
12071208

12081209
```javascript
@@ -1300,7 +1301,7 @@ test('movie title appears', async () => {
13001301

13011302
### :clap: Doing It Right Example: Stubbing or intercepting API calls
13021303
![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg
1303-
"Examples with React") ![](https://img.shields.io/badge/🔧%20Example%20using%20Jest-blue.svg
1304+
"Examples with React") ![](https://img.shields.io/badge/🔧%20Example%20using%20React%20Testing%20Library-blue.svg
13041305
"Examples with react-testing-library")
13051306

13061307
```javascript
@@ -1663,7 +1664,7 @@ Knowing that all or most of the mutations were killed gives much higher confiden
16631664
### :thumbsdown: Anti Pattern Example: 100% coverage, 0% testing
16641665

16651666
![](https://img.shields.io/badge/🔨%20Example%20using%20Stryker-blue.svg
1666-
"Using Cypress to illustrate the idea")
1667+
"Using Stryker")
16671668
```javascript
16681669
function addNewOrder(newOrder) {
16691670
logger.log(`Adding new order ${newOrder}`);
@@ -1759,7 +1760,7 @@ it("Test name", () => {*//error:no-identical-title. Assign unique titles to test
17591760

17601761
:white_check_mark: **Do:** Using a CI with shiny quality inspections like testing, linting, vulnerabilities check, etc? Help developers run this pipeline also locally to solicit instant feedback and shorten the [feedback loop](https://www.gocd.org/2016/03/15/are-you-ready-for-continuous-delivery-part-2-feedback-loops/). Why? an efficient testing process constitutes many and iterative loops: (1) try-outs -> (2) feedback -> (3) refactor. The faster the feedback is, the more improvement iterations a developer can perform per-module and perfect the results. On the flip, when the feedback is late to come fewer improvement iterations could be packed into a single day, the team might already move forward to another topic/task/module and might not be up for refining that module.
17611762

1762-
Practically, some CI vendors (Example: [CircleCI load CLI](https://circleci.com/docs/2.0/local-cli/)) allow running the pipeline locally. Some commercial tools like [wallaby provide highly-valuable & testing insights](https://wallabyjs.com/) as a developer prototype (no affiliation). Alternatively, you may just add npm script to package.json that runs all the quality commands (e.g. test, lint, vulnerabilities) — use tools like [concurrently](https://www.npmjs.com/package/concurrently) for parallelization and non-zero exit code if one of the tools failed. Now the developer should just invoke one command — e.g. ‘npm run quality’ — to get instant feedback. Consider also aborting a commit if the quality check failed using a githook ([husky can help](https://github.com/typicode/husky))
1763+
Practically, some CI vendors (Example: [CircleCI local CLI](https://circleci.com/docs/2.0/local-cli/)) allow running the pipeline locally. Some commercial tools like [wallaby provide highly-valuable & testing insights](https://wallabyjs.com/) as a developer prototype (no affiliation). Alternatively, you may just add npm script to package.json that runs all the quality commands (e.g. test, lint, vulnerabilities) — use tools like [concurrently](https://www.npmjs.com/package/concurrently) for parallelization and non-zero exit code if one of the tools failed. Now the developer should just invoke one command — e.g. ‘npm run quality’ — to get instant feedback. Consider also aborting a commit if the quality check failed using a githook ([husky can help](https://github.com/typicode/husky))
17631764
<br/>
17641765

17651766

@@ -1927,7 +1928,7 @@ An efficient update policy may allow some ‘vesting period’ — let the c
19271928
<br/>
19281929

19291930
### :clap: Example: [ncu](https://www.npmjs.com/package/npm-check-updates) can be used manually or within a CI pipeline to detect to which extent the code lag behind the latest versions
1930-
![alt text](assets/bp-27-yoni-goldberg-npm.png "Nncu can be used manually or within a CI pipeline to detect to which extent the code lag behind the latest versions")
1931+
![alt text](assets/bp-27-yoni-goldberg-npm.png "ncu can be used manually or within a CI pipeline to detect to which extent the code lag behind the latest versions")
19311932

19321933

19331934
</details>

0 commit comments

Comments
 (0)