Testing & The Container API

Testing .astro components has historically been difficult because they only run in the Astro environment.

The Container API

Astro provides a Container API that allows you to render .astro components in isolation for unit testing. You can pass props and slots and inspect the resulting HTML.

Integration Testing