string
--diff=<path>
DiffOptions object or a path to a module which exports DiffOptions. Useful if you want to customize diff display.
For example, as a config object:
import { defineConfig } from 'vitest/config'
import c from 'picocolors'
export default defineConfig({
test: {
diff: {
aIndicator: c.bold('--'),
bIndicator: c.bold('++'),
omitAnnotationLines: true,
},
},
})
Or as a module:
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
diff: './vitest.diff.ts',
},
})
import type { DiffOptions } from 'vitest'
import c from 'picocolors'
export default {
aIndicator: c.bold('--'),
bIndicator: c.bold('++'),
omitAnnotationLines: true,
} satisfies DiffOptions
boolean
true
--diff.expand=false
Expand all common lines.
number
0
--diff.truncateThreshold=<path>
The maximum length of diff result to be displayed. Diffs above this threshold will be truncated. Truncation won't take effect with default value 0.
string
'... Diff result is truncated'
--diff.truncateAnnotation=<annotation>
Annotation that is output at the end of diff result if it's truncated.
DiffOptionsColor = (arg: string) => string
noColor = (string: string): string => string
Color of truncate annotation, default is output with no color.
boolean
false
Print basic prototype Object and Array in diff output
number
20 (or 8 when comparing different types)Limit the depth to recurse when printing nested objects
© 2021-Present VoidZero Inc. and Vitest contributors
Licensed under the MIT License.
https://vitest.dev/config/diff