@cevek/screentest 0.3.7 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/dist/global-setup.js +14953 -70
- package/dist/index.js +626 -116
- package/dist/runner.js +19 -9
- package/dist/web/assets/index-CQ8ij0HR.js +72 -0
- package/dist/web/assets/index-DWf2oQZg.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-Bi-jx470.css +0 -1
- package/dist/web/assets/index-BvqwrlU8.js +0 -72
package/README.md
CHANGED
|
@@ -7,11 +7,16 @@ screenshots. Everything ships in one npm package — no copy-paste.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm i -D @cevek/screentest playwright vitest
|
|
11
|
-
# pnpm add -D @cevek/screentest playwright vitest
|
|
12
|
-
# yarn add -D @cevek/screentest playwright vitest
|
|
10
|
+
npm i -D @cevek/screentest playwright vitest
|
|
11
|
+
# pnpm add -D @cevek/screentest playwright vitest
|
|
12
|
+
# yarn add -D @cevek/screentest playwright vitest
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
No host browser install — every frame is rendered by the pinned Firefox in
|
|
16
|
+
the Docker daemon, so Docker is required. `snapshot.json` also records a
|
|
17
|
+
fingerprint of the renderer its hashes came from; when a run's renderer
|
|
18
|
+
differs and most screenshots changed, the log and the review UI say so.
|
|
19
|
+
|
|
15
20
|
`playwright` and `vitest` are peer-deps — keep them in your devDependencies.
|
|
16
21
|
|
|
17
22
|
## Quick start
|
|
@@ -20,11 +25,8 @@ npm i -D @cevek/screentest playwright vitest && npx playwright install firefox
|
|
|
20
25
|
# 1. Scaffold vitest.screentest.config.ts + tests/example.test.ts
|
|
21
26
|
npx screentest init
|
|
22
27
|
|
|
23
|
-
# 2.
|
|
24
|
-
#
|
|
25
|
-
npx screentest serve
|
|
26
|
-
|
|
27
|
-
# 3. Run.
|
|
28
|
+
# 2. Run. The first run builds the shared Firefox daemon image (~2 min,
|
|
29
|
+
# cached forever after) and starts the daemon; later runs reuse it.
|
|
28
30
|
APP_URL=http://localhost:5050 npx vitest run --config vitest.screentest.config.ts
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -56,7 +58,7 @@ our globalSetup; plain `vitest run` skips it entirely — no Firefox launch.
|
|
|
56
58
|
## Commands
|
|
57
59
|
|
|
58
60
|
```bash
|
|
59
|
-
screentest serve # start the shared Firefox
|
|
61
|
+
screentest serve # start the shared Firefox daemon up front (test runs start it on their own)
|
|
60
62
|
screentest stop # stop it
|
|
61
63
|
screentest status # is it running?
|
|
62
64
|
```
|