Files
connect/test/setupTests.ts
2023-01-02 13:10:45 +01:00

11 lines
252 B
TypeScript

//setupTests.tsx
import crypto from 'crypto';
import { TextEncoder, TextDecoder } from 'util';
global.TextEncoder = TextEncoder;
(global as any).TextDecoder = TextDecoder;
Object.defineProperty(global.self, 'crypto', {
value: crypto.webcrypto,
});