test(import): fetch-mock harness + coverage for existing importers#60
Merged
tompscanlan merged 1 commit intoJul 7, 2026
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 globalfetchwith 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
mainas-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 frommain).Verification
npm test→ 19 tests green, no networknpm run check→ 0 errors