mirror of
https://github.com/hanzoai/account-sdk.git
synced 2026-09-24 16:55:42 +00:00
* reorg * clean up mocks * config * apply :core * vendor * vendor-js * interface * rename RPCFetch * message and communicator as core * move move move * cipher * remove reversed hierarchy imports * error * constants * wow * errors * remove dead code * errors * errrorrororor * erererrs * FUCK alias * yay * fix jest alias * clear persisted connection type on disconnect (#110) * Nate/bugfix3 (#112) * just clear keys instead of resetting, generate new keys the next time keymanager is used * ts --------- Co-authored-by: Nate Reiners <[email protected]>
26 lines
604 B
TypeScript
26 lines
604 B
TypeScript
import '@testing-library/jest-dom';
|
|
|
|
import { Crypto } from '@peculiar/webcrypto';
|
|
import { TextDecoder, TextEncoder } from 'util';
|
|
|
|
global.crypto = new Crypto();
|
|
|
|
global.TextEncoder = TextEncoder;
|
|
|
|
// @ts-expect-error Use util TextDecoder
|
|
global.TextDecoder = TextDecoder;
|
|
|
|
expect.extend({
|
|
toThrowEIPError(received, code, message) {
|
|
const expected = expect.objectContaining({
|
|
code,
|
|
message,
|
|
});
|
|
return {
|
|
pass: this.equals(received, expected),
|
|
message: () =>
|
|
this.utils.printDiffOrStringify(expected, received, 'Expected', 'Received', true),
|
|
};
|
|
},
|
|
});
|