Using Jasmine's done() Callback for Asynchronous Tests
Learn how to use Jasmine's done() callback to properly test asynchronous code, with a worked example, explanation of Jasmine's waiting mechanism, and common pitfalls to avoid.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to use Jasmine's done() callback to properly test asynchronous code, with a worked example, explanation of Jasmine's waiting mechanism, and common pitfalls to avoid.
Learn how Jasmine's done() callback prevents flaky async tests by pausing specs until asynchronous work finishes, with a concrete setTimeout example and practical verification steps.
jasmine.clock().install() replaces native setTimeout, setInterval and Date with a controllable fake clock. Advance virtual time with clock.tick(ms) to test timer-dependent code synchronously, then uninstall to restore natives and avoid spec leakage.
Jasmine spies let you replace real collaborators with lightweight stand‑ins. This guide shows how to use spyOn, createSpy, and createSpyObj, gives a concrete example, discusses trade‑offs, and offers actionable best‑practice tips.
Goal: Determine whether a custom asymmetric equality tester written for Jasmine 6.x will function correctly under Jasmine 7.0.1 without modification. Constraints: The project uses Node.js 14 and installs Jasmine via npm; the only published change between v6.3.0 and v7.0.1 is the version bump released on 15 Aug. Specific questions: Does the jasmine.addMatcher