@@ -9,9 +9,10 @@ readable, reusable, and refactorable software in JavaScript. Enjoy!
9
9
2 . [ Functions] ( #functions )
10
10
3 . [ Objects and Data Structures] ( #objects-and-data-structures )
11
11
4 . [ Classes] ( #classes )
12
- 5 . [ Concurrency] ( #concurrency )
13
- 6 . [ Formatting] ( #formatting )
14
- 7 . [ Comments] ( #comments )
12
+ 5 . [ Testing] ( #testing )
13
+ 6 . [ Concurrency] ( #concurrency )
14
+ 7 . [ Formatting] ( #formatting )
15
+ 8 . [ Comments] ( #comments )
15
16
16
17
## ** Variables**
17
18
### Use meaningful and pronounceable variable names
@@ -1393,6 +1394,21 @@ class EmployeeTaxData {
1393
1394
```
1394
1395
** [ ⬆ back to top] ( #table-of-contents ) **
1395
1396
1397
+ ## ** Testing**
1398
+ Testing is more important than shipping. If you have have no tests or an
1399
+ inadequate amount, then every time you ship code you won't be sure that you
1400
+ didn't break anything. Deciding on what constitutes an adequate amount is up
1401
+ to your team, but having 100% coverage (all statements and branches) is how
1402
+ you achieve very high confidence and developer peace of mind.
1403
+
1404
+ There's no excuse to not write tests. There's [ plenty of good JS test frameworks]
1405
+ (http://jstherightway.org/#testing-tools ), so find one that your team prefers.
1406
+ When you find one that works for your team, then aim to always write tests
1407
+ for every new feature/module you introduce. If your preferred method is
1408
+ Test Driven Development (TDD), that is great, but the main point is to just
1409
+ make sure you are reaching your coverage goals before launching any feature,
1410
+ or refactoring an existing one.
1411
+
1396
1412
## ** Concurrency**
1397
1413
### Use Promises, not callbacks
1398
1414
Callbacks aren't clean, and they cause excessive amounts of nesting. With ES6,
0 commit comments