An official testing library that lets you write unit tests for UI extensions on any surface — Checkout / Admin / Customer Accounts / POS — without booting Shopify's runtime host. With type-safe mocks that match the real APIs, you can render in isolation, simulate interactions, and assert behavior.
@shopify/ui-extensions-tester With it, you canskip booting Shopify's runtime hostand writeunit testsfor extensions on any surface.
Verifying an extension's behavior required a live Shopify host (a real environment). There was no official way to quickly validate just the logic in isolation.
Use the extension API'styped mocksto render the extension in isolation → simulate interactions → assert behavior against its public API. All in a fully type-safe way.
Renders the extension into a standard DOM environment, so you can query (search and retrieve) the output with standard testing patterns.
The mocked shopify globals use the same types as the real API, so incorrect API usage is caught at test time.
Sensible mock defaults are provided for each of Checkout / Admin / Customer Accounts / POS, so tests "just work" out of the box.
Fire user interactions and test asynchronous state changes with dispatchEvent() or @testing-library/preact .
With strongly typed mocks and predictable testing patterns, the article explicitly notes that it is well suited toAI-assisted test-driven development (TDD).
Extensions on any of these surfaces can be tested without a running Shopify host.
| Item | Before | @shopify/ui-extensions-tester |
|---|---|---|
| Runtime environment | Host required Assumes a running Shopify host | No host required Runs entirely in a standard DOM environment |
| API mocking | No official typed mocks | Officially provided Mocks with the same types as the real API |
| Surface support | — | Defaults for Checkout / Admin / Customer Accounts / POS |
| Reproducing user interactions | Mostly manual operation in real environments | dispatchEvent() @testing-library/preact Simulate with |
| Detecting API misuse | Often only surfaces at runtime | At test time Caught at test time via types |
Get the full details from the official documentation.
Begin from the per-surface sample test suites as a foundation.
Render the extension, simulate interactions, and assert against the public API.
This official testing library is provided from API version 2026-04 and later. Confirm your extension's version alignment before using it.
These are unit tests that complete without a running Shopify host, so they're easy to wire into per-PR CI runs and automated regression tests.
Because the mocked shopify globals share the same types as the real API, incorrect API usage surfaces as type errors at test time.
Firing user interactions and asserting async state changes is done with dispatchEvent() or @testing-library/preact .
Strong typing and predictable test patterns make it explicitly well-suited to AI-assisted test-driven development. Used as a verification harness for AI-generated code, incorrect API usage is rejected by the types, reducing rework.
dispatchEvent() also lets you verify asynchronous state transitions.shopify global mirrors the real API's shape, so any AI misuse is caught at test time.