Skip to main content

Automated testing for Shopify UI extensions with @shopify/ui-extensions-tester

As of API version 2026-04, Shopify provides an official testing library for UI extensions. @shopify/ui-extensions-tester lets you write unit tests for extensions on any surface — Checkout, Admin, Customer Accounts, and POS — without a running Shopify host.

What it does

The library provides strongly typed mocks of the extension API, so you can render extensions in isolation, simulate user interactions, and verify behaviour against public APIs with full type safety.

Key capabilities

  • Render and query: Render your extension in a standard DOM environment and query the output using standard testing patterns.
  • Type-safe mocks: The mocked shopify global uses the same types as the real API, catching incorrect API usage at test time.
  • Surface-specific defaults: Sensible mock defaults for each target surface (Checkout, Admin, Customer Accounts, POS) so tests work out of the box.
  • Event simulation: Trigger user interactions and test async state changes with dispatchEvent() or @testing-library/preact.
  • AI-agent friendly: Strongly typed mocks and predictable test patterns make the library well-suited for AI-assisted test-driven development.

Getting started

Read documentation to learn more. Get started with example test suites for every surface.

Was this section helpful?