Using Jasmine's done() Callback to Test Asynchronous Code Reliably
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.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
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
Investigate the this-binding behavior of Jasmine spyOn when applied to prototype methods in Jasmine 4, particularly how the configuration interacts with and.callThrough(). The goal is to determine whether prototype method invocation via an instance reliably receives the correct context, or whether intermittent failures correlate with spy configuration choice
Goal is to use Jasmine 5 native ES module support with package.json "type": "module" and a jasmine.json config file in both local development and CI pipelines. Jasmine 5 loads the config via dynamic import(). Node.js 18.19+ stabilizes ESM without flags, while Node 16/17 require --experimental-vm-modules for ESM config loading. The Jasmine CLI does not auto-d
Goal Confirm whether Jasmine automatically converts an unhandled promise rejection inside an async test into a spec failure, and identify the conditions that influence this behavior across releases. Constraints & Uncertainty Jasmine 3.6+ claims to treat rejected promises or thrown errors in async functions as failures, but earlier releases lack native as
jasmine.clock().install() globally replaces setTimeout, setInterval, and Date with deterministic fakes for the duration of a spec. In Jasmine 4.x and 5.x, the clock remains installed until uninstall() is called manually; the framework does not automatically restore real timers when a spec throws, times out, or finishes. Because installation is global to the
Goal The objective is to emit Slack alerts only for failing specs while suppressing notifications for passing ones. The custom reporter must filter events, send an HTTP POST to a webhook, and avoid generating noise during a CI run. Constraints & Uncertainty Asynchronous reporter logic: it is unclear whether Jasmine guarantees that pending HTTP requests a