UNPKG

@relaycorp/webcrypto-kms

Version:

WebCrypto-compatible client for Key Management Services like GCP KMS

31 lines 767 B
// tslint:disable-next-line:readonly-array export function mockSpy(spy, // tslint:disable-next-line:readonly-array mockImplementation) { beforeEach(() => { spy.mockReset(); if (mockImplementation) { spy.mockImplementation(mockImplementation); } }); afterAll(() => { spy.mockRestore(); }); return spy; } export function getMockInstance(mockedObject) { return mockedObject; } export function getMockContext(mockedObject) { const mockInstance = getMockInstance(mockedObject); return mockInstance.mock; } export function useFakeTimers() { beforeEach(() => { jest.useFakeTimers(); }); afterEach(() => { jest.useRealTimers(); }); } //# sourceMappingURL=jest.js.map