Path: blob/main/integration/testdata/tstestrunner/testutil/setup.ts
1007 views
import { beforeAll, expect } from "vitest";12// Make sure that the tests have fetch API support3import "isomorphic-unfetch";45type Account = {6Name: string;7Address: string;8Mnemonic: string;9Coins: string[];10};1112type GlobalAccounts = {13[name: string]: Account;14};1516beforeAll(() => {17// Initialize required globals18globalThis.txApi = process.env.TEST_TX_API || "";19globalThis.queryApi = process.env.TEST_QUERY_API || "";2021expect(globalThis.txApi, "TEST_TX_API is required").not.toEqual("");22expect(globalThis.queryApi, "TEST_QUERY_API is required").not.toEqual("");2324// Initialize the global accounts25globalThis.accounts = <GlobalAccounts>{};2627JSON.parse(process.env.TEST_ACCOUNTS || "[]").forEach((account: Account) => {28globalThis.accounts[account.Name] = account;29});30});313233