A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
/* Copyright 2026 Marimo. All rights reserved. */
import { describe, expect, it, vi } from "vitest";
import { raf2 } from "../focus-utils";
describe("raf2", () => {
it("should call callback after two animation frames", async () => {
const callback = vi.fn();
raf2(callback);
expect(callback).not.toHaveBeenCalled();
await new Promise((resolve) => requestAnimationFrame(resolve));
expect(callback).not.toHaveBeenCalled();
await new Promise((resolve) => requestAnimationFrame(resolve));
expect(callback).toHaveBeenCalledTimes(1);
});
});