Skip to content

fix: align mock mode outputs with actual node output schemas#65

Open
FelixNg1022 wants to merge 1 commit into
wespreadjam:mainfrom
FelixNg1022:fix/mock-schema-mismatch
Open

fix: align mock mode outputs with actual node output schemas#65
FelixNg1022 wants to merge 1 commit into
wespreadjam:mainfrom
FelixNg1022:fix/mock-schema-mismatch

Conversation

@FelixNg1022

Copy link
Copy Markdown

Summary

  • Update all 9 hardcoded mock outputs in mock-generator.ts to match the real Zod output schemas
  • Fixes mismatches for: end, delay, map, filter, http_request, reddit_monitor, twitter_monitor, social_keyword_generator, and draft_emails

Closes #62

Changes

Node Before (wrong) After (matches schema)
end terminated, reason completed, message
delay delayed, delayMs waited, actualDurationMs, message
map result (array only) results, count
filter result, filteredCount results, count, originalCount
http_request data statusText, body, ok, durationMs
reddit_monitor flat fields platform, engagement object, proper author fields
twitter_monitor flat fields platform, engagement object, proper author fields
social_keyword_generator keywords, hashtags topic, twitter, reddit, linkedin, allKeywords
draft_emails drafts array emails with full fields, draftedCount

Test plan

  • Run jam run end --mock --input '{"message":"done"}' and verify output matches EndOutputSchema
  • Run jam run delay --mock --input '{"durationMs":1000}' and verify output matches DelayOutputSchema
  • Verify each mock output can be successfully parsed by its corresponding Zod output schema

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
Copilot AI review requested due to automatic review settings April 3, 2026 22:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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, engagement objects) to reflect required schema properties.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 186 to +190
reddit_monitor: {
posts: [
{
id: 'mock_post_1',
platform: 'reddit',

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 207 to +214
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',

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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.

CLI playground --mock mode output doesn't match node schemas

2 participants