mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
* remove metrics build * remove segment server from tests * enable cors * mock segment globally * metrics e2e test * running test builds * move file * destructuring
27 lines
594 B
JavaScript
27 lines
594 B
JavaScript
async function setupMocking(server, testSpecificMock) {
|
|
await server.forAnyRequest().thenPassThrough();
|
|
|
|
await server
|
|
.forGet('https://gas-api.metaswap.codefi.network/networks/1/gasPrices')
|
|
.thenCallback(() => {
|
|
return {
|
|
statusCode: 200,
|
|
json: {
|
|
SafeGasPrice: '1',
|
|
ProposeGasPrice: '2',
|
|
FastGasPrice: '3',
|
|
},
|
|
};
|
|
});
|
|
|
|
await server.forPost('https://api.segment.io/v1/batch').thenCallback(() => {
|
|
return {
|
|
statusCode: 200,
|
|
};
|
|
});
|
|
|
|
testSpecificMock(server);
|
|
}
|
|
|
|
module.exports = { setupMocking };
|