Commit 5bf5a967 authored by Ates Goral's avatar Ates Goral
Browse files

Use jest.requireMock instead of the deprecated require.requireMock

parent b53df287
......@@ -8,7 +8,7 @@ import {AuthConfig} from '../../types';
import Error from '../errors';
jest.mock('../validate-hmac', () => jest.fn(() => true));
const validateHmac = require.requireMock('../validate-hmac');
const validateHmac = jest.requireMock('../validate-hmac');
const baseConfig: AuthConfig = {
apiKey: 'myapikey',
......
......@@ -8,7 +8,7 @@ jest.mock('nonce', () => {
const fakeFactory = jest.fn();
return () => fakeFactory;
});
const nonce = require.requireMock('nonce');
const nonce = jest.requireMock('nonce');
const query = querystring.stringify.bind(querystring);
const fakeNonce = 'fakenonce';
......
......@@ -4,7 +4,7 @@ jest.mock('safe-compare', () => {
return jest.fn((first: string, second: string) => first === second);
});
const safeCompare = require.requireMock('safe-compare');
const safeCompare = jest.requireMock('safe-compare');
const data = {fiz: 'buzz', foo: 'bar'};
const secret = 'some secret';
const hmac = '7c66606415117ff9744a2a9b2be1712a15928b5ef474ab1a9ff5dc36b7dcaed8';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment