Skip to content

Commit

Permalink
docs: update vite.config.ts to vitest.config.ts (#4259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Oct 6, 2023
1 parent 1f58a42 commit de52215
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ Define custom aliases when running inside tests. They will be merged with aliase
By default, `vitest` does not provide global APIs for explicitness. If you prefer to use the APIs globally like Jest, you can pass the `--globals` option to CLI or add `globals: true` in the config.

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand All @@ -424,7 +424,7 @@ To get TypeScript working with the global APIs, add `vitest/globals` to the `typ
If you are already using [`unplugin-auto-import`](https://github.com/antfu/unplugin-auto-import) in your project, you can also use it directly for auto importing those APIs.

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'
import AutoImport from 'unplugin-auto-import/vite'

Expand Down
6 changes: 3 additions & 3 deletions docs/guide/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Both `v8` and `istanbul` support are optional. By default, `v8` will be used.
You can select the coverage tool by setting `test.coverage.provider` to `v8` or `istanbul`:

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand Down Expand Up @@ -58,7 +58,7 @@ By default, reporter `['text', 'html', 'clover', 'json']` will be used.
To configure it, set `test.coverage` options in your config file:

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand All @@ -75,7 +75,7 @@ export default defineConfig({
It's also possible to provide your custom coverage provider by passing `'custom'` in `test.coverage.provider`:

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Learn more about [Test Filtering](./filtering.md).

## Running tests concurrently

Use `.concurrent` in consecutive tests to run them in parallel.
Use `.concurrent` in consecutive tests to run them in parallel.

```ts
import { describe, it } from 'vitest'
Expand Down Expand Up @@ -129,7 +129,7 @@ $ npm i -D jsdom
After that, change the `environment` option in your config file:

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/in-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if (import.meta.vitest) {
Update the `includeSource` config for Vitest to grab the files under `src/`:

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand All @@ -55,7 +55,7 @@ $ npx vitest
For the production build, you will need to set the `define` options in your config file, letting the bundler do the dead code elimination. For example, in Vite

```ts
// vite.config.ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'

export default defineConfig({
Expand Down

0 comments on commit de52215

Please sign in to comment.