From ec48612d22e3029b13c4f44c9f95649da3122bba Mon Sep 17 00:00:00 2001 From: bhavik Date: Fri, 10 Dec 2021 23:20:43 +0530 Subject: [PATCH] added test --- test/0x/api.js | 59 ------------------------------------------ test/0x/zeroEx.test.js | 2 -- 2 files changed, 61 deletions(-) delete mode 100644 test/0x/api.js diff --git a/test/0x/api.js b/test/0x/api.js deleted file mode 100644 index 30201ac5..00000000 --- a/test/0x/api.js +++ /dev/null @@ -1,59 +0,0 @@ -import axios from "axios"; -import { childLogger } from "./logger"; - -const logger = childLogger("utils/api"); - -function getApi() { - const api = axios.create({}); - - api.interceptors.request.use( - (request) => { - logger.info({ - msg: "Request to external API", - req: { - method: request.method, - url: request.url, - params: request.params, - headers: request.headers, - }, - }); - - return request; - }, - (error) => { - logger.error({ msg: "Error while requesting external API", error }); - - return Promise.reject(error); - } - ); - - api.interceptors.response.use( - (response) => { - logger.info({ - msg: "Response from external API", - req: { - method: response.config.method, - url: response.config.url, - params: response.config.params, - }, - res: { - statusCode: response.status, - statusText: response.statusText, - headers: response.config.headers, - data: response.data, - }, - }); - - return response; - }, - (error) => { - logger.error({ msg: "Error response from external API", error }); - - return Promise.reject(error); - } - ); - - return api; -} - -export default getApi(); diff --git a/test/0x/zeroEx.test.js b/test/0x/zeroEx.test.js index fe1ffa03..804cde5b 100644 --- a/test/0x/zeroEx.test.js +++ b/test/0x/zeroEx.test.js @@ -5,8 +5,6 @@ const { web3, deployments, waffle, ethers } = hre; const { provider, deployContract } = waffle; const BigNumber = require("bignumber.js"); -// import axpi from "./api"; - const deployAndEnableConnector = require("../../scripts/deployAndEnableConnector.js"); const buildDSAv2 = require("../../scripts/buildDSAv2"); const encodeSpells = require("../../scripts/encodeSpells.js");