Files
account-sdk/packages/wallet-sdk/jest.setup.ts
Jungho BangandNate Reiners 2689e95d69 Clean up - reorg to remove inverted/deep imports, clean up dead code, alias (#109)
* 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]>
2024-02-28 22:28:28 -07:00

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),
};
},
});