You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
594 B
27 lines
594 B
3 years ago
|
async function setupMocking(server, testSpecificMock) {
|
||
|
await server.forAnyRequest().thenPassThrough();
|
||
3 years ago
|
|
||
3 years ago
|
await server
|
||
3 years ago
|
.forGet('https://gas-api.metaswap.codefi.network/networks/1/gasPrices')
|
||
|
.thenCallback(() => {
|
||
|
return {
|
||
|
statusCode: 200,
|
||
|
json: {
|
||
|
SafeGasPrice: '1',
|
||
|
ProposeGasPrice: '2',
|
||
|
FastGasPrice: '3',
|
||
|
},
|
||
|
};
|
||
|
});
|
||
3 years ago
|
|
||
3 years ago
|
await server.forPost('https://api.segment.io/v1/batch').thenCallback(() => {
|
||
|
return {
|
||
|
statusCode: 200,
|
||
|
};
|
||
|
});
|
||
|
|
||
3 years ago
|
testSpecificMock(server);
|
||
3 years ago
|
}
|
||
|
|
||
|
module.exports = { setupMocking };
|