File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # PrettyHtmlLog
1+ # @ angular-extensions/pretty-html-log
22
3- Work in progress
3+ This module allows you to pretty print the inner HTML
4+ of ` ComponentFixtures ` ,
5+ ` DebugElements ` , ` NativeElements ` or even plain HTML ` strings ` to the console.
6+
7+ ## Getting started
8+
9+ This module will only be used during development and can therefore
10+ be installed as a dev dependency.
11+
12+ ```
13+ npm i -D @angular-extension/pretty-html-log
14+ ```
15+
16+ This module is best used with Angular and Jest. Create a
17+ ` setupJest.ts ` file in your ` src ` directory and import
18+ ` @angular-extension/pretty-html-log ` .
19+
20+ This import adds a ` logNgHTML ` method to your console. You can then
21+ use this method during tests to pretty print ` ComponentFixtures ` ,
22+ ` DebugElements ` , ` NativeElements ` or even plain HTML ` strings ` .
23+
24+ ## Examples
25+
26+ In your test you can simply write the following line.
27+
28+ ![ logNgHTML] ( https://raw.githubusercontent.com/angular-extensions/pretty-html-log/master/doc/console.logNgHMTL.png )
29+
30+ Which will print the following string to your console
31+
32+ ![ logNgHTML] ( https://raw.githubusercontent.com/angular-extensions/pretty-html-log/master/doc/output.png )
You can’t perform that action at this time.
0 commit comments