Skip to content

chore(@binstruct/png): use built-in t.assertSnapshot instead of @std/testing/snapshot - #300

Merged
hertzg merged 1 commit into
mainfrom
hertzg/deno-snapshot-testing-audit
Sep 23, 2026
Merged

hertzg merged 1 commit into
mainfrom
hertzg/deno-snapshot-testing-audit

Conversation

@hertzg

@hertzg hertzg commented Sep 19, 2026

Copy link
Copy Markdown
Owner

@std/testing/snapshot is deprecated and slated for removal in 2.0.0. Deno 2.9+ ships the same API as t.assertSnapshot() on the test context, using the same __snapshots__/*.snap format, so the existing snapshot file is untouched.

Changes:

  • pngsuite.test.ts calls t.assertSnapshot(value, { serializer }) instead of importing createAssertSnapshot.
  • @std/testing/snapshot removed from import_map.json; nothing else used it.

Snapshots are now updated with deno test -u (a real CLI flag) rather than -- --update.

Verified locally on Deno 2.9.5 that the built-in reads the existing snapshot keys (basic > basn0g01.png ... 1) without changes. deno task lint and deno task test pass.

Not in this PR: pngsuite/ is excluded in the package deno.json, so this test does not run today. Its snapshots are stale (a zlib header field was renamed) and it no longer type-checks. That is a separate fix.

…testing/snapshot

@std/testing/snapshot is deprecated and slated for removal in 2.0.0.
Deno 2.9+ ships the same API on the test context, with the same
__snapshots__ file format, so the existing snapshot file stays valid.
Update with `deno test -u` from now on. The import map entry goes with it
since nothing else used it.
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview: https://hertzg.github.io/jsr-monorepo/pr/300/

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

Category Count
🟢 Improved (beyond noise floor) 2
⚪ Unchanged 29

packages/@hertzg/tplink-api/client/cipher/cipher.bench.ts

Benchmark Base PR Change
aesDecrypt (512 bytes) 6.49 µs 5.53 µs 🟢 -14.90% (1.18x faster)
aesEncrypt (512 bytes) 6.13 µs 5.29 µs 🟢 -13.68% (1.16x faster)

Benchmark comparison generated automatically. Results may vary between runs.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.79%. Comparing base (823a066) to head (06d4e4c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #300   +/-   ##
=======================================
  Coverage   96.79%   96.79%           
=======================================
  Files         159      159           
  Lines        8499     8499           
  Branches     1300     1300           
=======================================
  Hits         8227     8227           
  Misses        152      152           
  Partials      120      120           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hertzg
hertzg merged commit 8858052 into main Sep 23, 2026
7 checks passed
@hertzg
hertzg deleted the hertzg/deno-snapshot-testing-audit branch September 23, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants