Skip to content

Commit efe5fc2

Browse files
authored
chore: add an example at the top of the power-assert plugin page (#4312)
1 parent b179204 commit efe5fc2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/topics/power-assert.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ It simplifies the process of writing tests by automatically generating
1212
intermediate values in failure messages.
1313
It helps you understand why a test failed without needing complex assertion libraries.
1414

15+
This is an example message provided by the plugin:
16+
17+
```text
18+
Incorrect length
19+
assert(hello.length == world.substring(1, 4).length) { "Incorrect length" }
20+
| | | | | |
21+
| | | | | 3
22+
| | | | orl
23+
| | | world!
24+
| | false
25+
| 5
26+
Hello
27+
```
28+
1529
The Power-assert plugin key features:
1630

1731
* **Enhanced error messages**: The plugin captures and displays the values of variables and

0 commit comments

Comments
 (0)