I get some strange leakage between tests... I have a test that succeeds if other tests are commente

I get some strange leakage between tests...

I have a test that succeeds if other tests are commented out, or if it's anywhere but the first test to run. It will also succeed on live reload.

It fails because
const ran = await runDurableObjectAlarm(stub); expect(ran).toBe(true);
// expects true but is false

    it("adds jobs and schedules an alarm", async () => {
      const result = await runInDurableObject(stub, async (instance, state) => {
        return await instance.addJobs([
          { url: "https://example.com" },
          { url: "https://example.org" },
        ]);
      });
      expect(result).toBe("Jobs added");

      // Run the alarm (which calls processQueue & processTimeouts)
      const ran = await runDurableObjectAlarm(stub);
      expect(ran).toBe(true);

      const status = await runInDurableObject(stub, async (instance) => {
        return await instance.getStatus();
      });
      expect(status).toEqual([{ status: "pending", count: 2 }]);
    });


The add jobs instance call simply inserts some records and sets an alarm
Was this page helpful?