Skip to content

Commit

Permalink
Add vitest info to docs (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Oct 4, 2022
1 parent 008e935 commit 7906df0
Showing 1 changed file with 20 additions and 0 deletions.
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"],
},
});
```

0 comments on commit 7906df0

Please sign in to comment.