Skip to content

Commit 7b737ed

Browse files
fix(test): update SW test to accept self-destruct mode
The service worker was changed to self-destruct mode (clears all caches on activate) for reliable asset updates during development. The test previously expected a specific cache version string. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 574f57a commit 7b737ed

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎packages/studyctl/tests/test_web_vendor.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ def test_sw_caches_inter_font(self):
7070
assert "/vendor/css/inter.css" in content
7171
assert "/vendor/css/files/inter-latin.woff2" in content
7272

73-
def test_sw_cache_version_bumped(self):
73+
def test_sw_self_destruct_or_cache_version(self):
74+
"""SW should either be in self-destruct mode or have a cache version."""
7475
content = (STATIC_DIR / "sw.js").read_text()
75-
assert "studyctl-v7" in content
76+
has_self_destruct = "Self-destruct" in content and "skipWaiting" in content
77+
has_cache_version = "studyctl-v" in content
78+
assert has_self_destruct or has_cache_version, (
79+
"sw.js must be in self-destruct mode or have a studyctl-vN cache version"
80+
)

0 commit comments

Comments
 (0)