Type Testing
This section covers testing which programs should compile and which should be rejected. Every lesson stands alone while fitting the beginner-to-staff progression.
Learning outcomes
- Explain runtime and compile-time responsibilities.
- Write a correct example without unsafe escape hatches.
- Diagnose a representative compiler error.
- Identify API, performance, security, and production trade-offs.
- Apply the concept in a project or interview.
Lessons
- Runtime Tests vs Type Tests
- @ts-expect-error
- @ts-ignore
- Type Assertions in Tests
- Expect-Type Patterns
- tsd
- Vitest Type Testing
- Declaration Tests
- Negative Type Tests
- Library Contract Tests
Study method
Run the examples under strict checking, intentionally introduce an error, explain the diagnostic, and finish the exercises.