Skip to content

Conversation

@saga-dasgupta
Copy link

@saga-dasgupta saga-dasgupta commented Sep 22, 2025

Background

Fixes: https://github.com/orgs/shop/projects/147/views/9?pane=issue&itemId=125817929&issue=shop%7Cissues-shopifyvm%7C552

We want to have a way for developers to test their compiled functions for various scenarios and find out when it breaks everytime they make changes to their extension. We want to develop a test suite that they can run which actually builds a function and runs a function with a previous run's logged input and asserts its the same as the logged output.
We are adding a default passing wasm-level test fixture and test to all function extension templates to which developers can add on.
These wasm-level tests replace the unit tests that are baked into the templates.

Solution

I created an app with every type of extension in both JS and Rust and then created a fixture along with a default test that passes, then copied the test directory for each extension over here to its corresponding template so I feel pretty confident in my changes, even though I haven't tophatted it, unsure how I can tophat this.
The package.json in all the test directories are the same. The default.test.js for different extensions have different input query path but is otherwise the same.
There is a second follow-up PR that removes all existing unit tests.
This PR also needs this helper to get published to NPM.

Checklist

  • I have 🎩'd these changes
  • I have squashed my commits into chunks of work with meaningful commit messages

@saga-dasgupta saga-dasgupta force-pushed the sd.fixtures_in_function_templates branch from cfe775b to 366f402 Compare September 22, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant