Skip to content

Conversation

@sylvain-abadie
Copy link
Contributor

@sylvain-abadie sylvain-abadie commented Jan 22, 2026

Description

Screenshot 2026-01-22 at 12 31 51 PM

Adds the server.forwardClientLogs config option to forward console.log, console.warn, console.error, etc. from the device to the terminal during test execution.

Related Issue

N/A

Context

  • Uses Metro's built-in forwardClientLogs server option to receive client_log events
  • Formats logs using util.format() to support printf-style specifiers (%s, %d, etc.)
  • Styled output with colored level tags (LOG, WARN, ERROR, INFO, DEBUG) matching Jest's visual style

Testing

  • Added unit tests in packages/jest/src/__tests__/client-log-handler.test.ts
  • Manual testing with playground app using various console methods

@vercel
Copy link

vercel bot commented Jan 22, 2026

@sylvain-abadie is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@V3RON
Copy link
Contributor

V3RON commented Jan 23, 2026

Screenshot 2026-01-23 at 10 19 57 Does it make sense to prefix logs with the HARNESS tag so it's clear where the logs are coming from? 🤔

@sylvain-abadie
Copy link
Contributor Author

Screenshot 2026-01-23 at 10 19 57 Does it make sense to prefix logs with the HARNESS tag so it's clear where the logs are coming from? 🤔

It's not something that you usually see in jest tests AFAIK. I personally agree with you that it adds clarity but I also don't want to stray too far from what people are used to. Happy to add a prefix if you feel it's the right approach. Let me know.

@V3RON V3RON self-requested a review January 23, 2026 20:34
Copy link
Contributor

@V3RON V3RON left a comment

Choose a reason for hiding this comment

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

I went ahead and added a version plan, and I also moved forwardClientLogs to the root of the config object.

Thanks for the contribution! 👏

@V3RON V3RON merged commit b83f01b into callstackincubator:main Jan 23, 2026
1 of 2 checks passed
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.

2 participants