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.
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(jest-runner): Handle unsafe worker_threads
structureClone
withfunction
type in matchers #14436base: main
Are you sure you want to change the base?
fix(jest-runner): Handle unsafe worker_threads
structureClone
withfunction
type in matchers #14436Changes from 5 commits
a2a54a0
627031c
3a3295f
76791cc
e0f991a
9db8b2e
ec421c8
3f50677
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I get it right: the problem is that
failureDetails
includes data which cannot be serialised? If so, it be better to serialised it earlier in the test runner.This was discussed already, I will try to dig out the thread. The idea is that we know in advance that all what the runner returns has to be serialisable, because that data will be passed through workers. If I remember it right, the test runner is already serialising most of the data. Seem like something was simply overlooked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly, the problem with
function
type which throw an error during clone. Also DOM nodes might cause similar behaviour, but I'm not sure if it's a valid case for workers.I was also thinking about it, my only concern was that it might be exposed to other tools (outside of
jest
repo). But if the approach is ok I can fix this and add some tests to cover the serialisationSounds good, found this related PR, would be nice to look into other discussions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is. I was talking about #11467. The conclusions are made in #11467 (comment) and following comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrazauskas Thanks a lot, now I have full context