Skip to content

Add Vitest test suite for pure-logic modules#1927

Draft
sweenzor wants to merge 2 commits intogildas-lormeau:masterfrom
sweenzor:test-suite
Draft

Add Vitest test suite for pure-logic modules#1927
sweenzor wants to merge 2 commits intogildas-lormeau:masterfrom
sweenzor:test-suite

Conversation

@sweenzor
Copy link

@sweenzor sweenzor commented Mar 20, 2026

Some ideas about how a test suite for SingleFile might look. Let me know your thoughts @gildas-lormeau!

Summary

  • Add Vitest with 95 tests covering pure-logic modules that don't require browser APIs
  • Test srcset parser, MHTML utilities, yabson serialization round-trips, and config/download helpers
  • Extract pure functions from config.js and downloads.js into config-utils.js so they are importable without browser dependencies

Test plan

  • npm test -- all 95 tests pass
  • npm run build -- rollup build still succeeds (confirms extraction didn't break imports)
  • npx eslint . -- no lint errors in new/modified files

sweenzor and others added 2 commits March 20, 2026 13:36
Test srcset parser, MHTML utilities, yabson serialization round-trips,
and config/download helpers. Extract pure functions from config.js and
downloads.js into config-utils.js to make them importable without
browser API dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@@ -0,0 +1,99 @@
/*
* Copyright 2010-2020 Gildas Lormeau
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Copyright 2010-2020 Gildas Lormeau
* Copyright 2010-2026 Gildas Lormeau

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant