createMockActionContext helper from the framework.
For a full working example, see the text-helper piece tests on GitHub.
Setup
1. Add vitest to your piece
Addvitest as a dev dependency in your piece’s package.json and add a test script:
2. Create a vitest config
Createvitest.config.ts in your piece root:
3. Write tests
Create atest/ directory and add .test.ts files: