Skip to content

Commit

Permalink
test: mock with node
Browse files Browse the repository at this point in the history
  • Loading branch information
sparten11740 committed Jan 23, 2025
1 parent 790e007 commit efac0f5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions features/keychain/module/__tests__/sodium.test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { mnemonicToSeed } from 'bip39'
import { mock } from 'node:test'

import KeyIdentifier from '@exodus/key-identifier'
import { getSeedId } from '../crypto/seed-id.js'
import { getSodiumKeysFromSeed } from '@exodus/crypto/sodium'

const getSodiumKeysFromSeedMock = jest.fn(getSodiumKeysFromSeed)

jest.mock('@exodus/crypto/sodium', () => ({
__esModule: true,
getSodiumKeysFromSeed: getSodiumKeysFromSeedMock,
}))
mock.module('@exodus/crypto/sodium', {
namedExports: {
getSodiumKeysFromSeed: getSodiumKeysFromSeedMock,
},
})

const { default: createKeychain } = await import('./create-keychain.js')

Expand Down

0 comments on commit efac0f5

Please sign in to comment.