Skip to content

Commit 3c27d1f

Browse files
Fix tests
1 parent 9cc2446 commit 3c27d1f

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

packages/snaps-rpc-methods/jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module.exports = deepmerge(baseConfig, {
1010
],
1111
coverageThreshold: {
1212
global: {
13-
branches: 95.2,
14-
functions: 98.63,
15-
lines: 98.83,
16-
statements: 98.51,
13+
branches: 94.96,
14+
functions: 98.64,
15+
lines: 98.76,
16+
statements: 98.45,
1717
},
1818
},
1919
});

packages/snaps-simulation/src/methods/hooks/get-mnemonic-seed.test.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,42 @@
1-
import { mnemonicPhraseToBytes } from '@metamask/key-tree';
1+
import { TEST_SECRET_RECOVERY_PHRASE_SEED_BYTES } from '@metamask/snaps-utils/test-utils';
22

33
import { getGetMnemonicSeedImplementation } from './get-mnemonic-seed';
4-
import { DEFAULT_ALTERNATIVE_SRP, DEFAULT_SRP } from '../../constants';
4+
import { DEFAULT_ALTERNATIVE_SRP } from '../../constants';
55

66
describe('getGetMnemonicSeedImplementation', () => {
7+
const alternativeSeedBytes = new Uint8Array([
8+
94, 176, 11, 189, 220, 240, 105, 8, 72, 137, 168, 171, 145, 85, 86, 129,
9+
101, 245, 196, 83, 204, 184, 94, 112, 129, 26, 174, 214, 246, 218, 95, 193,
10+
154, 90, 196, 11, 56, 156, 211, 112, 208, 134, 32, 109, 236, 138, 166, 196,
11+
61, 174, 166, 105, 15, 32, 173, 61, 141, 72, 178, 210, 206, 158, 56, 228,
12+
]);
13+
714
it('returns the default mnemonic seed', async () => {
815
const getMnemonicSeed = getGetMnemonicSeedImplementation();
916
expect(await getMnemonicSeed()).toStrictEqual(
10-
mnemonicPhraseToBytes(DEFAULT_SRP),
17+
TEST_SECRET_RECOVERY_PHRASE_SEED_BYTES,
1118
);
1219

1320
expect(await getMnemonicSeed('default')).toStrictEqual(
14-
mnemonicPhraseToBytes(DEFAULT_SRP),
21+
TEST_SECRET_RECOVERY_PHRASE_SEED_BYTES,
1522
);
1623
});
1724

1825
it('returns the seed of the provided default mnemonic phrase', async () => {
1926
const getMnemonicSeed = getGetMnemonicSeedImplementation(
2027
DEFAULT_ALTERNATIVE_SRP,
2128
);
22-
expect(await getMnemonicSeed()).toStrictEqual(
23-
mnemonicPhraseToBytes(DEFAULT_ALTERNATIVE_SRP),
24-
);
29+
expect(await getMnemonicSeed()).toStrictEqual(alternativeSeedBytes);
2530

2631
expect(await getMnemonicSeed('default')).toStrictEqual(
27-
mnemonicPhraseToBytes(DEFAULT_ALTERNATIVE_SRP),
32+
alternativeSeedBytes,
2833
);
2934
});
3035

3136
it('returns the alternative mnemonic seed', async () => {
3237
const getMnemonicSeed = getGetMnemonicSeedImplementation();
3338
expect(await getMnemonicSeed('alternative')).toStrictEqual(
34-
mnemonicPhraseToBytes(DEFAULT_ALTERNATIVE_SRP),
39+
alternativeSeedBytes,
3540
);
3641
});
3742

packages/snaps-simulator/jest.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ module.exports = deepmerge(baseConfig, {
88
coverageThreshold: {
99
global: {
1010
branches: 54.33,
11-
functions: 60.59,
12-
lines: 80.54,
13-
statements: 80.83,
11+
functions: 60.43,
12+
lines: 80.49,
13+
statements: 80.79,
1414
},
1515
},
1616
setupFiles: ['./jest.setup.js'],

0 commit comments

Comments
 (0)