# Test your extension
URL: https://docs.awellhealth.com/docs/extensions/test-your-extension

> For the complete documentation index, see [llms.txt](https://docs.awellhealth.com/llms.txt).



Test an extension with unit tests against its code, or by running the full extension server locally.

## Unit tests with jest are the recommended approach [#unit-tests-with-jest-are-the-recommended-approach]

An action's logic is ordinary TypeScript, so test it like any other TypeScript: given this payload, does
it call `onComplete` with the right result, and does it call `onError` when the third-party call fails?

Write the `onError` case first. An action that only handles the happy path leaves care flows stuck when
the other system fails. See [The onEvent function](/docs/extensions/on-event).

## Run the full extension server when the wiring is the problem [#run-the-full-extension-server-when-the-wiring-is-the-problem]

To exercise the whole path, run the extension server application locally using the pub/sub emulator.

It catches wiring failures rather than logic errors: the action isn't being found, or the payload isn't
the shape the action expects.

## Next steps [#next-steps]

**Next:** [Deploy your extension](/docs/extensions/deploy-your-extension).
