# JavaScript Level 14: Testing & Code Quality

> Level 14: Testing & Code Quality of the LoWisa JavaScript course: Unit and Integration Testing, Static Analysis and Linting, Designing Testable JavaScript. 3 lessons and 9 ideas, each explained in one line.

Testing & Code Quality is level 14 of 16 of the [LoWisa JavaScript course](/courses/javascript/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Unit and Integration Testing

- **Unit tests.** A **unit** test calls one function with known inputs and asserts the exact output: small, fast, and ruthless.
- **Integration tests.** An **integration** test exercises several parts together, catching the wiring mistakes unit tests cannot see.
- **Arrange, act, assert.** Readable tests keep three moves in order: **arrange** the world, act once, assert what must now be true.

## Static Analysis and Linting

- **Linting.** A **linter** reads code without running it and flags likely bugs: unused variables, sloppy equality, unreachable branches.
- **Formatting.** A **formatter** rewrites style automatically so reviews argue about behaviour, never about commas.
- **CI gates.** Running lint and tests in **CI** on every change turns quality from a habit into a guarantee.

## Designing Testable JavaScript

- **Injecting dependencies.** Pass collaborators in as **parameters** instead of reaching for globals, and tests can substitute them freely.
- **Separating logic from effects.** Keep calculations **pure** and push network and DOM work to the edges: the pure core tests in microseconds.
- **Test doubles.** A **mock** stands in for a real dependency, letting a test script the network’s answers and assert what was sent.

## Before and after this level

- **Before:** [Level 13: Runtime & Memory](/courses/javascript/level-13-runtime-and-memory/): Call Stack, Heap and Garbage Collection, References and Memory Behaviour, Finding Memory and Runtime Problems.
- **Next:** [Level 15: Performance & Security](/courses/javascript/level-15-performance-and-security/): Performance Profiling, Common JavaScript Security Risks, Reliable Production Patterns.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does JavaScript Level 14: Testing & Code Quality cover?

Unit and Integration Testing, Static Analysis and Linting, Designing Testable JavaScript: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 13: Runtime & Memory, which covers Call Stack, Heap and Garbage Collection, References and Memory Behaviour, Finding Memory and Runtime Problems.

## Learn JavaScript on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/javascript/level-14-testing-and-code-quality/ · Updated 2026-11-16
