From b3fe9d24c48ce79f1dffeac4728c0b1eeffb47a3 Mon Sep 17 00:00:00 2001 From: Edmundo Rodrigues Date: Wed, 12 Jul 2017 18:21:42 -0300 Subject: [PATCH] Remove duplicate block, move pure functions explanation (#59) --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f135509..6f858cf 100644 --- a/README.md +++ b/README.md @@ -260,11 +260,6 @@ Having a good guideline for creating commits and sticking to it makes working wi _Why:_ > While sometimes end to end testing in `production` mode might seem enough, there are some exceptions: One example is you may not want to enable analytical information on a 'production' mode and pollute someone's dashboard with test data. The other example is that your API may have rate limits in `production` and blocks your test calls after certain amount of requests. -* Write testable code, avoid side effect, extract side effects, write pure functions. - - _Why:_ - > A pure function is a function that always returns the same output for the same input. Conversely, an impure function is one that may have side effects or depends on conditions from the outside to produce a value. That makes it less predictable [read more...](https://hackernoon.com/structure-your-javascript-code-for-testability-9bc93d9c72dc) - * Place your test files next to the tested modules using `*.test.js` or `*.spec.js` naming convention, like `moduleName.spec.js` _Why:_ @@ -280,7 +275,8 @@ Having a good guideline for creating commits and sticking to it makes working wi _Why:_ > You want to test a business logic as a separate units. You have to "minimize the impact of randomness and non-deterministic processes on the reliability of your code". [read more...](https://medium.com/javascript-scene/tdd-the-rite-way-53c9b46f45e3) - + + > A pure function is a function that always returns the same output for the same input. Conversely, an impure function is one that may have side effects or depends on conditions from the outside to produce a value. That makes it less predictable [read more...](https://hackernoon.com/structure-your-javascript-code-for-testability-9bc93d9c72dc) * Use a static type checker