styleproof 4.0.0 → 4.0.1
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/CHANGELOG.md +11 -0
- package/dist/runner.js +9 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.0.1] - 2026-07-07
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Unset capture specs no longer inflate Playwright's skipped-test count.** When
|
|
15
|
+
`defineStyleMapCapture({ dir: process.env.STYLEMAP_DIR, ... })` or
|
|
16
|
+
`defineCrawlCapture({ dir: process.env.STYLEMAP_DIR, ... })` runs with no `dir`,
|
|
17
|
+
StyleProof now returns before registering generated capture tests instead of
|
|
18
|
+
registering one skipped test per surface. Static `expected` coverage guards still
|
|
19
|
+
run in the normal suite. (#215)
|
|
20
|
+
|
|
10
21
|
## [4.0.0] - 2026-07-07
|
|
11
22
|
|
|
12
23
|
The first major since v3. Three breaking defaults make StyleProof strict out of
|
package/dist/runner.js
CHANGED
|
@@ -655,7 +655,6 @@ function writeBrowserBuildTest(settings, dir) {
|
|
|
655
655
|
}
|
|
656
656
|
export function defineStyleMapCapture(options) {
|
|
657
657
|
const { surfaces, expected, exclude = {}, dir } = options;
|
|
658
|
-
const settings = resolveSettings(options);
|
|
659
658
|
const captureSurfaces = surfaces.flatMap(expandSurfaceVariants);
|
|
660
659
|
assertUniqueExpandedKeys(captureSurfaces);
|
|
661
660
|
// Coverage guard. Runs in the NORMAL test suite (NOT gated on a capture dir), so
|
|
@@ -678,12 +677,12 @@ export function defineStyleMapCapture(options) {
|
|
|
678
677
|
});
|
|
679
678
|
});
|
|
680
679
|
}
|
|
680
|
+
if (!dir)
|
|
681
|
+
return;
|
|
682
|
+
const settings = resolveSettings(options);
|
|
681
683
|
test.describe('styleproof capture', () => {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
writeCoverageLedgerTest(settings, dir, expected ?? null, exclude, captureSurfaces);
|
|
685
|
-
if (dir)
|
|
686
|
-
writeBrowserBuildTest(settings, dir);
|
|
684
|
+
writeCoverageLedgerTest(settings, dir, expected ?? null, exclude, captureSurfaces);
|
|
685
|
+
writeBrowserBuildTest(settings, dir);
|
|
687
686
|
for (const surface of captureSurfaces) {
|
|
688
687
|
if (surface.widths && surface.widths.length > 0) {
|
|
689
688
|
// Explicit widths: one parallelizable test per surface × width.
|
|
@@ -785,11 +784,12 @@ async function sweepCrawlSurfaces(page, captureSurfaces, settings) {
|
|
|
785
784
|
}
|
|
786
785
|
export function defineCrawlCapture(options) {
|
|
787
786
|
const { from, match, key, widths, height, ignore, variants, liveStates, popups, linkTimeout = 15_000, dir, settle, expected, exclude = {}, } = options;
|
|
787
|
+
if (!dir)
|
|
788
|
+
return;
|
|
788
789
|
const settings = resolveSettings(options);
|
|
789
790
|
// Title contains "styleproof capture" so the same `--grep 'styleproof capture'`
|
|
790
791
|
// that styleproof-map uses to select capture tests picks up crawl specs too.
|
|
791
792
|
test.describe('styleproof capture (crawl)', () => {
|
|
792
|
-
test.skip(!dir, 'set STYLEMAP_DIR=<label> to capture computed-style maps');
|
|
793
793
|
// Record the completeness basis. Without `expected` a crawl has no registry to
|
|
794
794
|
// check against, so it records `expected: null` (honestly "not asserted": it
|
|
795
795
|
// captures what the nav links to, and can't prove that's every route). With
|
|
@@ -800,10 +800,8 @@ export function defineCrawlCapture(options) {
|
|
|
800
800
|
// `expected` key with this crawl's variants/liveStates to get the keys captured to
|
|
801
801
|
// disk, so a liveStates crawl's ledger is pre-translated like the spec-driven one.
|
|
802
802
|
const ledgerSurfaces = (expected ?? []).flatMap((key) => expandSurfaceVariants({ key, go: async () => { }, variants, liveStates }));
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
if (dir)
|
|
806
|
-
writeBrowserBuildTest(settings, dir);
|
|
803
|
+
writeCoverageLedgerTest(settings, dir, expected ?? null, exclude, ledgerSurfaces);
|
|
804
|
+
writeBrowserBuildTest(settings, dir);
|
|
807
805
|
test('discover surfaces by crawling links, then capture each', async ({ page }) => {
|
|
808
806
|
// 1. Load the root and read its hydrated nav links into the surface set.
|
|
809
807
|
const links = await discoverCrawlLinks(page, { from, match, key, linkTimeout });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "styleproof",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Catch every CSS change before it ships — review PRs and certify refactors by the browser's computed styles, not pixels. Works with any styling system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"playwright",
|