diff --git a/.gitignore b/.gitignore index 5dbd335d..bd5a46fb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ package-lock.json pnpm-lock.yaml yarn.lock test/temp.test.ts -test/rpcUrls.test.ts diff --git a/README.md b/README.md index db8fb9e7..ce486db1 100644 --- a/README.md +++ b/README.md @@ -2462,3 +2462,9 @@ import curve from "@curvefi/api"; // ] })() ``` + +## Tests + +```sh +npm run test +``` diff --git a/package.json b/package.json index 45aed2d4..6f85842c 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ }, "scripts": { "build": "rm -rf lib && tsc -p tsconfig.build.json", + "test": "npx tsc && mocha dist/test/*.test.js", "lint": "eslint src --ext .ts" }, "type": "module", diff --git a/test/apy.test.ts b/test/apy.test.ts index 64f734f6..695bbf8d 100644 --- a/test/apy.test.ts +++ b/test/apy.test.ts @@ -3,7 +3,7 @@ import curve from "../src/index.js"; import { curve as _curve } from "../src/curve.js"; import { getPool, PoolTemplate } from "../src/pools/index.js"; import { IReward } from "../src/interfaces.js"; -import { ETH_RPC, OPTIMISM_RPC, XDAI_RPC, POLYGON_RPC, FANTOM_RPC, MOONBEAM_RPC, KAVA_RPC, ARBITRUM_RPC, CELO_RPC, AVALANCHE_RPC, AURORA_RPC } from "./rpcUrls.test.js"; +import { ETH_RPC } from "./rpcUrls.test.js"; const poolStatsTest = (name: string) => { diff --git a/test/factoryPoolsData.test.ts b/test/factoryPoolsData.test.ts index 8d59102e..655992e8 100644 --- a/test/factoryPoolsData.test.ts +++ b/test/factoryPoolsData.test.ts @@ -1,6 +1,6 @@ import { assert } from "chai"; import { curve } from "../src/curve.js"; -import { ETH_RPC, ARBITRUM_RPC, AURORA_RPC } from "./rpcUrls.test.js"; +import { ETH_RPC } from "./rpcUrls.test.js"; import { IDict, IPoolData } from "../src/interfaces.js"; import { BLACK_LIST } from "../src/factory/factory.js"; diff --git a/test/rpcUrls.test.ts b/test/rpcUrls.test.ts new file mode 100644 index 00000000..7b9a4fe2 --- /dev/null +++ b/test/rpcUrls.test.ts @@ -0,0 +1 @@ +export const { ETH_RPC } = process.env;