Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix truncated JSON output with JSON reporter #512

Merged
merged 3 commits into from
Feb 15, 2024

Conversation

refractalize
Copy link
Contributor

Hello - I noticed that when using --reporter=json on a project with a lot of unused code the JSON output was truncated. This seems to be due to this known issue, a combination of large output (> 65k) followed by process.exit(). See this issue: nodejs/node#6379.

I've applied the workaround documented in that (and related) issues.

Let me know if you think I should write a test for it.

@webpro
Copy link
Collaborator

webpro commented Feb 13, 2024

Thanks @refractalize! I'm willing to just merge it, unless you have a simple/performant way to test this?

@refractalize
Copy link
Contributor Author

unless you have a simple/performant way to test this?

Nothing that comes to mind. We could get some tests around it perhaps if we extract a function that writes output, and test that in isolation, but yeah, it'd be launching a new executable that writes a lot of stdout then exits immediately afterwards, not that elegant. What I might do is just add a comment with a link referring to the known issue in node.js.

@webpro webpro merged commit fabacab into webpro-nl:main Feb 15, 2024
8 of 11 checks passed
@webpro
Copy link
Collaborator

webpro commented Feb 15, 2024

Thanks @refractalize!

@webpro
Copy link
Collaborator

webpro commented Feb 23, 2024

🚀 This pull request is included in v5.0.2. See Release 5.0.2 for release notes.

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