Add test infrastructure and extract reusable utilities#132
Open
jakebromberg wants to merge 1 commit intomainfrom
Open
Add test infrastructure and extract reusable utilities#132jakebromberg wants to merge 1 commit intomainfrom
jakebromberg wants to merge 1 commit intomainfrom
Conversation
Test utilities: - Add shared test helpers (createTestLifecycle, createMockFetch, withEnvVars) - Add test data factories for Instagram posts and blog edges New tests (78 tests): - instagramFilter: extractInstagramPostId, getSuppressedInstagramIds, filterInstagramPosts - organizingArchive: groupEventsByWeek, generateStructuredData - instagram: formatInstagramPost, fetchInstagramPosts, getInstagramFeed - timeUtils: calculateTime formatting - breadcrumbUtils: toTitleCase, slugToTitle, generateBreadcrumbs Improved existing tests (7 tests): - posthog: loaded callback behavior in dev/prod modes - stream-tracking: edge cases for duration, errors, page events Extracted utilities: - lib/timeUtils.js: calculateTime from AudioPlayerMP3 - lib/breadcrumbUtils.js: shared breadcrumb logic from Blog/ArchiveBreadcrumbs Coverage: 97.7% statements, 93.93% branches, 100% functions
05c226e to
686a1c1
Compare
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.
Summary
Test utilities:
createTestLifecycle,createMockFetch,withEnvVars)New tests (40 tests):
organizingArchive: groupEventsByWeek, generateStructuredDatatimeUtils: calculateTime formattingbreadcrumbUtils: toTitleCase, slugToTitle, generateBreadcrumbsImproved existing tests (7 tests):
posthog: loaded callback behavior in dev/prod modesstream-tracking: edge cases for duration, errors, page eventsExtracted utilities:
lib/timeUtils.js: calculateTime from AudioPlayerMP3lib/breadcrumbUtils.js: shared breadcrumb logic from Blog/ArchiveBreadcrumbsTest plan