Isolating Unit Dependencies with Jasmine Spies
Learn how to use Jasmine Spies to isolate units of code, replace real dependencies with mocks, and verify function calls without triggering side effects.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to use Jasmine Spies to isolate units of code, replace real dependencies with mocks, and verify function calls without triggering side effects.
Replace dependencies in Jest tests using manual mocks stored in __mocks__ folders, with a worked example and limits.
Learn how to use Bun's built-in test runner to execute TypeScript unit tests without separate transpilation steps, reducing overhead and increasing developer velocity.
Learn how Jasmine spies let you mock dependencies, verify calls, and keep tests focused on the unit under test.
Stop leaving temporary files behind after tests. Learn how to use JUnit 5's @TempDir to automate the creation and cleanup of isolated test directories.
Jasmine's jasmine.addMatchers lets you express domain rules directly in specs. Learn how to define, scope, and verify a toBeWithinRange matcher—and where custom matchers add maintenance risk.
Keep private utilities private and still test them with Vitest in-source testing, then verify Vite strips the tests from production builds.
When Visual Studio’s Test Explorer shows no tests after a clean build, the issue is usually a discovery failure. This guide walks through the most common causes—missing adapters, build configuration, .runsettings filters, and corrupted cache—and shows how to verify and fix each one.
Step‑by‑step guide to replace a legacy directive with an AngularJS 1.5+ component, including setup, implementation, testing, and rollback.