Skip to content

Commit

Permalink
ci: reveal sdk/js-query test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Jul 31, 2024
1 parent 3e13e79 commit eebc7ae
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
16 changes: 15 additions & 1 deletion sdk/js-query/src/query/ethCall.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { beforeAll, describe, expect, jest, test } from "@jest/globals";
import axios, { AxiosResponse } from "axios";
import axios, { AxiosError, AxiosResponse } from "axios";
import Web3, { ETH_DATA_FORMAT } from "web3";
import {
ChainQueryType,
Expand All @@ -18,6 +18,20 @@ import {

jest.setTimeout(125000);

// Save Jest from circular axios errors
axios.interceptors.response.use(
(r) => r,
(err: AxiosError) => {
const error = new Error(
`${err.message}${err?.response?.data ? `: ${err.response.data}` : ""}`
) as any;
error.response = err.response
? { data: err.response.data, status: err.response.status }
: undefined;
throw error;
}
);

const CI = process.env.CI;
const ENV = "DEVNET";
const ETH_NODE_URL = CI ? "http://eth-devnet:8545" : "http://localhost:8545";
Expand Down
35 changes: 20 additions & 15 deletions sdk/js-query/src/query/solana.test.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
import {
afterAll,
beforeAll,
describe,
expect,
jest,
test,
} from "@jest/globals";
import Web3, { ETH_DATA_FORMAT } from "web3";
import axios from "axios";
import { AxiosResponse } from "axios";
import { describe, expect, jest, test } from "@jest/globals";
import axios, { AxiosError, AxiosResponse } from "axios";
import base58 from "bs58";
import {
ChainQueryType,
PerChainQueryRequest,
QueryRequest,
QueryResponse,
sign,
SolanaAccountQueryRequest,
SolanaAccountQueryResponse,
SolanaAccountResult,
SolanaPdaEntry,
SolanaPdaQueryRequest,
SolanaPdaQueryResponse,
PerChainQueryRequest,
QueryRequest,
sign,
QueryResponse,
} from "..";

jest.setTimeout(125000);

// Save Jest from circular axios errors
axios.interceptors.response.use(
(r) => r,
(err: AxiosError) => {
const error = new Error(
`${err.message}${err?.response?.data ? `: ${err.response.data}` : ""}`
) as any;
error.response = err.response
? { data: err.response.data, status: err.response.status }
: undefined;
throw error;
}
);

const CI = process.env.CI;
const ENV = "DEVNET";
const SERVER_URL = CI ? "http://query-server:" : "http://localhost:";
Expand Down

0 comments on commit eebc7ae

Please sign in to comment.