Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

471 B
Raw Blame
async_test((t) => {
  let wasPreviouslyCalled = false;

  const handle = setInterval(
    t.step_func(() => {
      if (!wasPreviouslyCalled) {
        wasPreviouslyCalled = true;

        clearInterval(handle);

        // Make the test succeed after the callback would've run next.
        setInterval(t.step_func_done(), 750);
      } else {
        assert_unreached();
      }
    }),
    500
  );
}, "Clearing an interval from the callback should still clear it.");