-
-
Notifications
You must be signed in to change notification settings - Fork 709
Description
One of my objects has a .inspect function that collides with chai/loupe's customInspect setting.
The options provided to loupe's inspect are hardcoded (which is why I'm opening the issue here rather than in loupe):
chai/lib/chai/utils/inspect.js
Lines 24 to 29 in 0b0353c
| let options = { | |
| colors: colors, | |
| depth: typeof depth === 'undefined' ? 2 : depth, | |
| showHidden: showHidden, | |
| truncate: config.truncateThreshold ? config.truncateThreshold : Infinity | |
| }; |
Setting customInspect: false below would disable the check.
https://github.com/chaijs/loupe/blob/b5b084b8429a3ad2ed4e8abfab2e3cdef92ba6e2/src/index.ts#L99-L101
There's already an issue over there questioning the validity of using a string-keyd 'inspect' function given that there is support for Symbols widely available chaijs/loupe#74, but it seems to have been missed by the maintainers of the repo.
https://github.com/chaijs/loupe/blob/b5b084b8429a3ad2ed4e8abfab2e3cdef92ba6e2/src/index.ts#L28-L30