-
Notifications
You must be signed in to change notification settings - Fork 42
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
bug: assertEquals
is not transpiled correctly
#235
Comments
I don't think there's anything dnt can do here. This should be handled in deno_std I think. |
Feel free to transfer the issue in that case. I wasn't aware that /std has the aim to be compatible with Node environments. |
Opened denoland/std#2954 |
@dsherret as far as I understand, We should prepend the following line to the generated output (or even add it into somewhere shim-deno): delete Object.prototype.__proto__; This is exactly how Deno disables I tested this idea while researching this issue and it works. For me it looks like a much better approach than modifying std for the needs of this specific case. WDYT? |
That could break other npm packages that use |
|
Ideally, Deno would support Ideally, dnt resembles this behaviour on Node. This would effectively mean that |
Does this difference actually affect the module testing? If there's no actual example usage, then maybe we can keep this behavior as a known limitation |
Yes. That's why I opened this issue. I use property-based testing which generates arbitrary objects that could be returned from JSON.parse. I expect my module to be able to handle these objects. All tests pass on Deno, but the build fails because the same tests don't work on Node. I currently implemented a fairly dirty workaround (it's at https://github.com/KnorpelSenf/oson/blob/ab4bb0e7081f0593acf5e85562fbce1d685ad2ee/mod.test.ts#L13 but please don't look at it) to skip calling |
How about passing |
It would be great if dnt would do this when running the tests, yes. Is there a way to configure it? |
How about passing via
|
Well fair enough, that makes sense, thanks |
Description
Node implements
__proto__
and Deno does not.assertEquals
relies on comparing string representations so it fails on Node but works on Deno.Repro
deno run mod.ts
and see how it worksnode npm
and see how it throws:The text was updated successfully, but these errors were encountered: