Skip to content

Commit

Permalink
fix: export DiffOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Sep 18, 2023
1 parent 13b59c8 commit b0774eb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/config/index.md
Expand Up @@ -1624,6 +1624,29 @@ Retry the test specific number of times if it fails.

- **Type:** `string`
- **CLI:** `--diff=<value>`
- **Version:** Since Vitest 0.34.4
- **Version:** Since Vitest 0.34.5

Path to a diff config that will be used to generate diff interface. Useful if you want to customize diff display.

:::code-group
```ts [vitest.diff.ts]
import type { DiffOptions } from 'vitest'
import c from 'picocolors'

export default {
aIndicator: c.bold('--'),
bIndicator: c.bold('++'),
omitAnnotationLines: true,
} satisfies DiffOptions
```

```ts [vitest.config.js]
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
diff: './vitest.diff.ts'
}
})
```
:::
1 change: 1 addition & 0 deletions packages/vitest/src/types/index.ts
Expand Up @@ -13,6 +13,7 @@ export type * from './worker'
export type * from './general'
export type * from './coverage'
export type * from './benchmark'
export { DiffOptions } from '@vitest/utils/diff'
export type {
EnhancedSpy,
MockedFunction,
Expand Down

0 comments on commit b0774eb

Please sign in to comment.