-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Using marvellous uint8arrays
library extensively. The recent change depends on multiformats
module instead of previous multibase
. Apparently, multiformats
uses conditional exports in its package.json
, and vanilla Jest can not handle those.
So, if some people start complaining on their tests failing with cryptic errors, like Cannot read property 'base16' of undefined
, please know, this is due to Jest unable to load multiformats
properly.
A solution I have for the downstream users is to use custom resolver for Jest (jest-resolver-enhanced), like in the following fragment of package.json
:
{
"jest": {
"resolver": "jest-resolver-enhanced"
},
}
Any other resolver capable of handling conditional exports is just as fine, but every one I know of, are unusable right now due to old age. Checked them all, IMO.