Skip to content

Commit 5c4e810

Browse files
committed
docs(readme): add README and images
1 parent f4af14a commit 5c4e810

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
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)

images/console.logNgHMTL.png

39.9 KB
Loading

images/output.png

49.5 KB
Loading

0 commit comments

Comments
 (0)