You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
essentially because of differences in how modules are handled. Some libraries handle this just fine, but babel + jest seems to add an extra unnecessary .default.
In my reading of it, that .default shouldn't be necessary as the import name from "module" should already be taking the default export. Removing the extra .default causes jest to work fine, but breaks your ava tests.
This makes me think that it's an issue with ava, but since I'm not super familiar, it was hard for me to trace down how ava is executing the imports. It seems like it's due to the very odd format of get-own-enumerable-property-symbols that exports an anonymous const arrow function, instead of a default named function or potentially a named const.
One fix for both jest and ava was to avoid depending get-own-enumerable-property-symbols and just redeclaring the relatively simple function inside stringify-object, but that has its own downsides.
This leaves a few potential solutions:
Do nothing and leave me to forking the patch :'(
Remove the default and figure out why ava seems to be misinterpreting the default export. This I probably can't help with.
Remove get-own-enumerable-property-symbols and inline the function. I have a PR ready, but wanted to see what your thoughts were before submitting it.
Something else that I missed or didn't understand that resolves this in some other way.
Thanks for the nice library!
The text was updated successfully, but these errors were encountered:
The way that
get-own-enumerable-property-symbols
is imported isn't supported by jest, and instead crashes with:A few day ago someone seems to asked about this on stack overflow, but gave up and just resorted to
JSON.stringify
.It's happening here:
stringify-object/index.js
Line 94 in e6ef8e2
essentially because of differences in how modules are handled. Some libraries handle this just fine, but babel + jest seems to add an extra unnecessary
.default
.In my reading of it, that
.default
shouldn't be necessary as theimport name from "module"
should already be taking the default export. Removing the extra.default
causes jest to work fine, but breaks your ava tests.This makes me think that it's an issue with ava, but since I'm not super familiar, it was hard for me to trace down how ava is executing the imports. It seems like it's due to the very odd format of
get-own-enumerable-property-symbols
that exports an anonymous const arrow function, instead of a default named function or potentially a named const.One fix for both jest and ava was to avoid depending
get-own-enumerable-property-symbols
and just redeclaring the relatively simple function insidestringify-object
, but that has its own downsides.This leaves a few potential solutions:
get-own-enumerable-property-symbols
and inline the function. I have a PR ready, but wanted to see what your thoughts were before submitting it.Thanks for the nice library!
The text was updated successfully, but these errors were encountered: