osmosis-labs / osmojs

OsmosJS makes it easy to compose and broadcast Osmosis and Cosmos messages
https://cosmology.zone/products/osmojs
Apache License 2.0
63 stars 32 forks source link

Jest raises Cannot read properties of undefined (reading 'sodium') #30

Closed fboucquez closed 1 year ago

fboucquez commented 1 year ago

Hi team, jest is raising this error when trying to use osmojs that depends on libsodium-wrappers

Minimal example:

import osmojs from 'osmojs'

test('osmojs', () => {
  console.log(osmojs)
})

Any hint on how to fix it?

pyramation commented 1 year ago

does it do this when you import a module, e.g.

import { cosmos, osmosis } from 'osmojs'

can you also share your environment?