2022-03-07 20:23:04 +01:00
|
|
|
async function setupMocking(server, testSpecificMock) {
|
|
|
|
await server.forAnyRequest().thenPassThrough();
|
2022-02-16 15:21:41 +01:00
|
|
|
|
2022-03-07 20:23:04 +01:00
|
|
|
await server
|
2022-02-16 15:21:41 +01:00
|
|
|
.forGet('https://gas-api.metaswap.codefi.network/networks/1/gasPrices')
|
|
|
|
.thenCallback(() => {
|
|
|
|
return {
|
|
|
|
statusCode: 200,
|
|
|
|
json: {
|
|
|
|
SafeGasPrice: '1',
|
|
|
|
ProposeGasPrice: '2',
|
|
|
|
FastGasPrice: '3',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
});
|
2022-02-22 17:48:12 +01:00
|
|
|
|
2022-03-15 17:17:48 +01:00
|
|
|
await server.forPost('https://api.segment.io/v1/batch').thenCallback(() => {
|
|
|
|
return {
|
|
|
|
statusCode: 200,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2022-02-22 17:48:12 +01:00
|
|
|
testSpecificMock(server);
|
2022-02-16 15:21:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = { setupMocking };
|