Skip to content

Commit

Permalink
Document new getViteConfig() option for Vitest (#8192)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
delucis and sarah11918 authored May 8, 2024
1 parent 5e5cf49 commit 8bb3031
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/content/docs/en/guides/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ export default getViteConfig({
});
```

By default, `getViteConfig()` will try to load an Astro config file in your project and apply it to the test environment.
As of Astro 4.8, if you need to customize the Astro configuration applied in your tests, pass a second argument to `getViteConfig()`:

```js
export default getViteConfig(
{ test: { /* Vitest configuration options */ } },
{
site: 'https://example.com/',
trailingSlash: 'always',
},
);
```

See the [Astro + Vitest starter template](https://github.com/withastro/astro/tree/latest/examples/with-vitest) on GitHub.

## Cypress
Expand Down

0 comments on commit 8bb3031

Please sign in to comment.