Skip to main content

Binary testing for Shopify Functions

We've released the @shopify/shopify-function-test-helpers package to simplify writing comprehensive integration tests for Shopify Functions using real production data. All function extension templates now include integration tests powered by this package.

Why this matters

  1. Test the actual WASM binary: Integration tests validate the compiled code uploaded to Shopify's infrastructure, helping to catch breaking changes before they hit production; including compilation errors, runtime crashes, or serialization issues that unit tests might miss.
  2. Easily add new scenarios: Create new fixtures in the tests/fixtures/ directory, and the test suite will automatically include them. There's no need to write additional test code for each new scenario.
  3. Build from real production data: Create your fixture library by copying function run logs directly from production. This enables you to test against the actual inputs your function encounters, ensuring your tests reflect real-world scenarios.

Learn more

For more details, visit the package page or explore the Shopify developer documentation.

Was this section helpful?