Skip to content

Commit 0a22e95

Browse files
committed
Update README.md
1 parent 636e4a8 commit 0a22e95

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
A preload library for Bun that provides a ready-to-use DOM environment for testing. It automatically sets up [happy-dom](https://github.com/capricorn86/happy-dom) and enables proper snapshot testing for React and HTML elements with beautifully formatted output.
44

5+
## Why?
6+
7+
Without this library, Bun's snapshot testing outputs unreadable React internals (FiberNode, stateNode, etc.):
8+
9+
![Before - Unreadable snapshot output](media/before.png)
10+
11+
With `bun-test-env-dom`, snapshots are clean, formatted HTML that's easy to read and review:
12+
13+
![After - Clean HTML snapshots](media/after.png)
14+
515
## Installation
616

717
```bash

media/after.png

192 KB
Loading

media/before.png

195 KB
Loading

0 commit comments

Comments
 (0)