Skip to content

test(import): fetch-mock harness + coverage for existing importers#60

Merged
tompscanlan merged 1 commit into
flo-bit:mainfrom
tompscanlan:test/import-harness-existing-importers
Jul 7, 2026
Merged

test(import): fetch-mock harness + coverage for existing importers#60
tompscanlan merged 1 commit into
flo-bit:mainfrom
tompscanlan:test/import-harness-existing-importers

Conversation

@tompscanlan

Copy link
Copy Markdown
Collaborator

Factors the reusable import-test infrastructure out of #58 so that PR carries only the guild.host importer and its own tests.

What's here

  • test-support.ts — a source-agnostic fetch-mock harness. Stubs the global fetch with an ordered route table so any importer can be driven against captured fixtures with zero live network; an unstubbed fetch throws (blockRealFetch).
  • raco.test.ts, ical.test.ts, webpage.test.ts — regression coverage for the pre-existing importers, built on that harness.

None of this references the guild importer — it applies cleanly to main as-is.

Why separate

#58 will be squash-merged, which would fold this unrelated test infra into the guild feature commit (@ghostdevv's catch). Landing it on its own keeps history honest. Merge order: this first, then #58 rebases onto it and keeps just the guild importer + guild.test.ts + pipeline.test.ts (which import the harness from main).

Verification

  • npm test → 19 tests green, no network
  • npm run check → 0 errors

A source-agnostic fetch-mock harness (test-support.ts) stubs the global
fetch with an ordered route table, so an importer can be driven against
captured fixtures with zero live network — an unstubbed fetch throws
(blockRealFetch). On top of it, regression tests for the pre-existing
raco / ical / webpage importers.

This is the reusable test infrastructure factored out of flo-bit#58 so the
guild.host importer PR carries only its own code and tests. Land this
first; flo-bit#58 rebases onto it and keeps just the guild importer + its tests.

19 tests, `npm test` green, no network.
@tompscanlan tompscanlan merged commit b034937 into flo-bit:main Jul 7, 2026
@tompscanlan tompscanlan deleted the test/import-harness-existing-importers branch July 7, 2026 21:00
tompscanlan added a commit to ghostdevv/atmo-events that referenced this pull request Jul 7, 2026
Guild-specific tests on top of the shared fetch-mock harness (test-support.ts,
landed in flo-bit#60): guild.test.ts drives the importer against three captured Guild
API fixtures, and pipeline.test.ts pins guild ahead of the fetch-based
importers so a guild paste routes straight to the JSON API. No live network.
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