chaiConfig
- Type:
- Default:
undefined
Customize the Chai config.
truncateThreshold
Sets the number of characters to display when showing large values in assertions. When an assertion fails and displays objects or arrays, Chai will truncate the output if it exceeds this threshold to keep error messages readable.
- Default:
40
A higher value shows more details in assertion failures, useful for debugging complex data structures:
With the default value (40), long arrays or objects get truncated:
If you set a higher threshold, you see the full structure:
This allows you to see the exact values that don't match, making debugging easier.
showDiff
Show a diff of expected vs actual values in assertion failures.
- Default:
true
Disable this if you want to see plain assertion messages without diffs:
By default, Rstest shows a diff of expected vs actual values in assertion failures:
If you set showDiff: false, Rstest will show plain assertion messages without diffs: