Back to Blog
Testing articles
Articles covering testing practies.
- Testing
Nullable type narrowing in tests
Non-trivial integration tests in TypeScript projects might require us to use functions that return Nullable types, especially when asserting side effects. This might force us to use less that ideal solutions such as type assertions or type-check ignoring comments. However, there is much better and elegant solution which we'll explore in detail.