JUnit 5 assertThrows: Verify Exceptions with a Simple Example
Learn how to use JUnit 5's assertThrows to verify exceptions, see a concrete code example, and avoid common pitfalls.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to use JUnit 5's assertThrows to verify exceptions, see a concrete code example, and avoid common pitfalls.
Learn how Vitest's snapshot matcher helps detect regressions in nested data, when to update snapshots, and why over‑reliance can hide real bugs.
Learn how Flask's application factory pattern creates isolated app instances, simplifies testing, and avoids extension state leaks—complete with a minimal code example and practical verification steps.
Learn how to mock a specific API call in Puppeteer using request interception to achieve deterministic UI tests without changing the backend.
Node.js’s native test runner lets you write and run unit tests with zero dependencies. This blog walks through a concrete example, shows how to enable coverage and mocking, and explains when the trade‑offs make it the right choice for backend services.
Puppeteer's request interception can block images, fonts, and trackers to cut bandwidth and runtime in scraping and CI — if you resolve every request and measure the actual savings.
Learn how Solidity custom errors (since 0.8.4) cut deployment size, provide typed revert data, and simplify testing—complete with a token‑gated example, trade‑offs, and verification steps.
Learn how Jest snapshot testing captures component output to detect unintended UI changes, with a concrete Button example, setup steps, and practical limitations.
When an expensive setup runs for every test, you’ll want a broader fixture scope. But widening scope can hide subtle test‑coupling bugs. This post explains how to pick the right scope, shows a concrete database example, and warns about the trade‑offs you’ll face.