diff --git a/README.md b/README.md
index 4412752d..0dab6f8b 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ Read in a different language: [**CN**](./README.chin
1. Project Architecture Practices (6)
-
+
[1.1 Structure your solution by components `#strategic`](#-11-structure-your-solution-by-business-components)
[1.2 Layer your components, keep the web layer within its boundaries `#strategic`](#-12-layer-your-components-with-3-tiers-keep-the-web-layer-within-its-boundaries)
[1.3 Wrap common utilities as npm packages](#-13-wrap-common-utilities-as-npm-packages)
@@ -101,6 +101,7 @@ Read in a different language: [**CN**](./README.chin
[3.10 Use the === operator](#-310-use-the--operator)
[3.11 Use Async Await, avoid callbacks `#strategic`](#-311-use-async-await-avoid-callbacks)
[3.12 Use arrow function expressions (=>)](#-312-use-arrow-function-expressions-)
+ [3.13 Avoid effects outside of functions #new](#-313-avoid-effects-outside-of-functions)
@@ -112,16 +113,16 @@ Read in a different language: [**CN**](./README.chin
[4.1 At the very least, write API (component) testing `#strategic`](#-41-at-the-very-least-write-api-component-testing)
[4.2 Include 3 parts in each test name `#new`](#-42-include-3-parts-in-each-test-name)
[4.3 Structure tests by the AAA pattern `#strategic`](#-43-structure-tests-by-the-aaa-pattern)
- [4.4 Detect code issues with a linter](#-44-detect-code-issues-with-a-linter)
+ [4.4 Ensure Node version is unified #new](#-44-ensure-node-version-is-unified)
[4.5 Avoid global test fixtures and seeds, add data per-test `#strategic`](#-45-avoid-global-test-fixtures-and-seeds-add-data-per-test)
- [4.6 Constantly inspect for vulnerable dependencies](#-46-constantly-inspect-for-vulnerable-dependencies)
- [4.7 Tag your tests `#advanced`](#-47-tag-your-tests)
- [4.8 Check your test coverage, it helps to identify wrong test patterns](#-48-check-your-test-coverage-it-helps-to-identify-wrong-test-patterns)
- [4.9 Inspect for outdated packages](#-49-inspect-for-outdated-packages)
- [4.10 Use production-like environment for e2e testing](#-410-use-production-like-environment-for-e2e-testing)
- [4.11 Refactor regularly using static analysis tools](#-411-refactor-regularly-using-static-analysis-tools)
- [4.12 Carefully choose your CI platform (Jenkins vs CircleCI vs Travis vs Rest of the world)](#-412-carefully-choose-your-ci-platform-jenkins-vs-circleci-vs-travis-vs-rest-of-the-world)
- [4.13 Test your middlewares in isolation](#-413-test-your-middlewares-in-isolation)
+ [4.6 Tag your tests `#advanced`](#-46-tag-your-tests)
+ [4.7 Check your test coverage, it helps to identify wrong test patterns](#-47-check-your-test-coverage-it-helps-to-identify-wrong-test-patterns)
+ [4.8 Use production-like environment for e2e testing](#-48-use-production-like-environment-for-e2e-testing)
+ [4.9 Refactor regularly using static analysis tools](#-49-refactor-regularly-using-static-analysis-tools)
+ [4.10 Mock responses of external HTTP services #advanced #new](#-410-mock-responses-of-external-http-services)
+ [4.11 Test your middlewares in isolation](#-411-test-your-middlewares-in-isolation)
+ [4.12 Specify a port in production, randomize in testing #new](#-412-specify-a-port-in-production-randomize-in-testing)
+ [4.13 Test the five possible outcomes #strategic #new](#-413-test-the-five-possible-outcomes)
@@ -441,12 +442,6 @@ especially if the cause of the abnormal behavior is inside of the missing functi
π [**Read More: Using ESLint and Prettier**](./sections/codestylepractices/eslint_prettier.md)
-## ![β] 3.2 Avoid effects outside of functions
-
-**TL;DR:** Avoid putting code with effects like network or DB calls outside of functions. Such a code will be executed immediately when another file requires the file. This 'floating' code might get executed when the underlying system is not ready yet. It also comes with a performance penalty even when this module's functions will finally not be used in runtime. Last, mocking these DB/network calls for testing is harder outside of functions. Instead, put this code with effects inside functions that should get called explicitly. If some DB/network code must get executed right when the module loads, consider using the factory or revealing module patterns
-
-**Otherwise:** A typical web framework sets error handler, environment variables and monitoring. When DB/network calls are made before the web framework is initialized, they won't be monitored and might fail due to a lack of configuration data
-
## ![β] 3.2 Node.js specific plugins
@@ -657,6 +652,14 @@ All statements above will return false if used with `===`
π [**Read more: Itβs Time to Embrace Arrow Functions**](https://medium.com/javascript-scene/familiarity-bias-is-holding-you-back-its-time-to-embrace-arrow-functions-3d37e1a9bb75)
+
+
+## ![β] 3.13 Avoid effects outside of functions
+
+**TL;DR:** Avoid putting code with effects like network or DB calls outside of functions. Such a code will be executed immediately when another file requires the file. This 'floating' code might get executed when the underlying system is not ready yet. It also comes with a performance penalty even when this module's functions will finally not be used in runtime. Last, mocking these DB/network calls for testing is harder outside of functions. Instead, put this code inside functions that should get called explicitly. If some DB/network code must get executed right when the module loads, consider using the factory or revealing module patterns
+
+**Otherwise:** A typical web framework sets error handler, environment variables and monitoring. When DB/network calls are made before the web framework is initialized, they won't be monitored or fail due to a lack of configuration data
+
β¬ Return to top
@@ -697,7 +700,7 @@ b. [Node.js testing - beyond the basics](https://github.com/testjavascript/nodej
-## ![β] 4.4 Ensure Node.js version is unified
+## ![β] 4.4 Ensure Node version is unified
**TL;DR:** Use tools that encourage or enforce the same Node.js version across different environments and developers. Tools like [nvm](https://github.com/nvm-sh/nvm), and [Volta](https://volta.sh/) allow specifying the project's version in a file so each team member can run a single command to conform with the project's version. Optionally, this definition can be replicated to CI and the production runtime (e.g., copy the specified value to .Dockerfile build and to the CI Node.js definition)