Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vitest info to docs #515

Merged
merged 2 commits into from Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions website/docs/getting-started/setup.md
Expand Up @@ -37,3 +37,23 @@ To automatically extend `expect` with all matchers, you can use
"setupFilesAfterEnv": ["jest-extended/all"]
}
```

## Use with `vitest`

`jest-extended` works with `vitest` because their `expect.extend` API is compatible. In your setup script:

```javascript
import {expect} from "vitest";
import * as matchers from "jest-extended";
expect.extend(matchers);
```

Add this setup script to your `vitest.config.js`:

```javascript
export default defineConfig({
test: {
setupFiles: ["./testSetup.js"],
},
});
```