Browse documentation

TypeScript SDK

Testing

Test device workflows without launching a simulator.

Create a fake backend

tsphone-use
import { FakeBackend, el, screen } from "@phone-use/sdk/testing";

const backend = new FakeBackend({
  screens: [
    screen([
      el({ ref: "1", role: "Button", label: "General" }),
    ]),
  ],
});

Included utilities

UtilityPurpose
FakeBackendPlay scripted screens and record calls
elCreate an observed-element fixture
screenCreate a snapshot fixture
scriptedExecRunnerTest lifecycle and command execution paths