-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Warn users on unsupported parts of setup
returned data
#2579
Comments
I would like to work on this issue. I'm new to the codebase but with some help, I will be able to make a PR. |
This is the place of the code where we marshal the data returned from Line 289 in 3305656
Feel free to try and implement this feature, just keep in mind that it's not as simple as it might look like. You'd need to be familiar with the Go and JS type systems and also might need to read up on some Goja internals (https://pkg.go.dev/github.com/dop251/goja)). We will also need a ton of tests here, to know that we are not making any breaking changes. |
@na-- I would like to pick up this issue. I'm new to the codebase, will read through goja and write a change proposal before staring the work! |
Connected to #2808 |
Sounds good, thanks! 👍 |
Feature Description
Currently
setup
can return whatever and it will be send todefault
andteardown
.A lot of users are confused what actually happens because for the most part it works perfectly and as long as you:
you can 100% think that it is just that exact same object.
But it isn't - it is a copy made by marshalling and then unmarshalling from JSON. This definitely makes it so
nil
... which is very confusing. Doubly so if it's a method on a class and the instance of that class is still there.teardown
will see the changes.Both of those are kind of documented, but I would expect that a lot of people wouldn't find them.
Suggested Solution (optional)
Write some, hopefully not very complicated code, to go through the whole object and check for known problems such as
functions
and print awarning
about it.We can probably try to write the name of the property or even the "path" to it as that will improve the message a lot.
For the second one we have discussed it a lot in #2043, but I wonder if we can just
freeze
that object after it's unmarshalled 🤷Already existing or connected issues / PRs (optional)
#2043
The text was updated successfully, but these errors were encountered: