karma-runner/karma
Voir sur GitHubSupport console.dir for pretty-printed object dumps when captureConsole=true
Open
#1 763 ouverte le 21 déc. 2015
help wantedtype: feature
Métriques du dépôt
- Stars
- (11 918 stars)
- Métriques de merge PR
- (Aucune PR mergée en 30 j)
Description
Sometimes when debugging I want to dump to console a pretty-printed object.
Normally in browser I'd use console.dir. In karma, this prints nothing, since dir is not listed here.
I can use console.dir but the output is an ugly non-readable one-liner.
So the scope of this issue would be to
- enable logging for
console.dirwhencaptureConsoleistrue - enhance a stringifier to be whitespace-aware (behing the flag), and pass that flag to the stringifier when logging from
console.dir. - maybe also change the depth in case of
console.dirto be more than3.
Would you be interested in receiving a PR with those changes?