[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
vitest docs config chaiconfig.md
1.2 kB


title: chaiConfig | Config outline: deep #

chaiConfig #

  • Type: { includeStack?, showDiff?, truncateThreshold? }
  • Default: { includeStack: false, showDiff: true, truncateThreshold: 40 }

Equivalent to Chai config.

chaiConfig.includeStack #

  • Type: boolean
  • Default: false

Influences whether stack trace is included in Assertion error message. Default of false suppresses stack trace in the error message.

chaiConfig.showDiff #

  • Type: boolean
  • Default: true

Influences whether or not the showDiff flag should be included in the thrown AssertionErrors. false will always be false; true will be true when the assertion has requested a diff to be shown.

chaiConfig.truncateThreshold #

  • Type: number
  • Default: 40

Sets length threshold for actual and expected values in assertion error messages. If this threshold is exceeded, for example for large data structures, the value is replaced with something like [ Array(3) ] or { Object (prop1, prop2) }. Set it to 0 if you want to disable truncating altogether.