Remove duplicate block, move pure functions explanation (#59)
This commit is contained in:
parent
a94e654fe5
commit
b3fe9d24c4
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user