fix: align mock mode outputs with actual node output schemas#65
fix: align mock mode outputs with actual node output schemas#65FelixNg1022 wants to merge 1 commit into
Conversation
Update all hardcoded mock outputs in mock-generator.ts to match the real Zod output schemas defined in each node. Fixes mismatches for: end, delay, map, filter, http_request, reddit_monitor, twitter_monitor, social_keyword_generator, and draft_emails. Closes wespreadjam#62
There was a problem hiding this comment.
Pull request overview
Updates the playground CLI --mock mode outputs to better align with the real node Zod output schemas, addressing schema mismatches reported in #62.
Changes:
- Updated mock outputs for multiple nodes (
end,delay,map,filter,http_request,reddit_monitor,twitter_monitor,social_keyword_generator,draft_emails) to match the expected output field names/shape. - Added additional fields to several mocks (e.g.,
count,durationMs,engagementobjects) to reflect required schema properties.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| reddit_monitor: { | ||
| posts: [ | ||
| { | ||
| id: 'mock_post_1', | ||
| platform: 'reddit', |
There was a problem hiding this comment.
reddit_monitor mock output still doesn't match RedditMonitorOutputSchema (packages/nodes/src/integrations/social/reddit-monitor.ts:74-95). The schema requires top-level totalFound and subredditsSearched, and each post must include upvoteRatio and postedAt (not createdAt). As-is, --mock output will fail schema parsing for this node.
| twitter_monitor: { | ||
| posts: [ | ||
| { | ||
| id: 'mock_tweet_1', | ||
| platform: 'twitter', | ||
| url: 'https://twitter.com/mockuser/status/mock_tweet_1', | ||
| text: 'Mock tweet content', | ||
| author: 'mockuser', | ||
| likes: 50, | ||
| retweets: 10, | ||
| authorName: 'Mock User', |
There was a problem hiding this comment.
twitter_monitor mock output is missing required fields from TwitterMonitorOutputSchema (packages/nodes/src/integrations/social/twitter-monitor.ts:96-117): top-level totalFound and hasMore, and per-post postedAt (the mock currently uses createdAt). This will cause schema parsing to fail in mock mode.
Summary
mock-generator.tsto match the real Zod output schemasend,delay,map,filter,http_request,reddit_monitor,twitter_monitor,social_keyword_generator, anddraft_emailsCloses #62
Changes
endterminated,reasoncompleted,messagedelaydelayed,delayMswaited,actualDurationMs,messagemapresult(array only)results,countfilterresult,filteredCountresults,count,originalCounthttp_requestdatastatusText,body,ok,durationMsreddit_monitorplatform,engagementobject, proper author fieldstwitter_monitorplatform,engagementobject, proper author fieldssocial_keyword_generatorkeywords,hashtagstopic,twitter,reddit,linkedin,allKeywordsdraft_emailsdraftsarrayemailswith full fields,draftedCountTest plan
jam run end --mock --input '{"message":"done"}'and verify output matchesEndOutputSchemajam run delay --mock --input '{"durationMs":1000}'and verify output matchesDelayOutputSchema