Some checks are pending
Docs Deploy / build_and_deploy (push) Waiting to run
Generate Docs / cli (push) Waiting to run
Generate Config Doc / cli (push) Waiting to run
Go formatting / go-formatting (push) Waiting to run
Check links / markdown-link-check (push) Waiting to run
Integration / pre-test (push) Waiting to run
Integration / test on (push) Blocked by required conditions
Integration / status (push) Blocked by required conditions
Lint / Lint Go code (push) Waiting to run
Test / test (ubuntu-latest) (push) Waiting to run
31 lines
807 B
TypeScript
31 lines
807 B
TypeScript
import { beforeAll, expect } from "vitest";
|
|
|
|
// Make sure that the tests have fetch API support
|
|
import "isomorphic-unfetch";
|
|
|
|
type Account = {
|
|
Name: string;
|
|
Address: string;
|
|
Mnemonic: string;
|
|
Coins: string[];
|
|
};
|
|
|
|
type GlobalAccounts = {
|
|
[name: string]: Account;
|
|
};
|
|
|
|
beforeAll(() => {
|
|
// Initialize required globals
|
|
globalThis.txApi = process.env.TEST_TX_API || "";
|
|
globalThis.queryApi = process.env.TEST_QUERY_API || "";
|
|
|
|
expect(globalThis.txApi, "TEST_TX_API is required").not.toEqual("");
|
|
expect(globalThis.queryApi, "TEST_QUERY_API is required").not.toEqual("");
|
|
|
|
// Initialize the global accounts
|
|
globalThis.accounts = <GlobalAccounts>{};
|
|
|
|
JSON.parse(process.env.TEST_ACCOUNTS || "[]").forEach((account: Account) => {
|
|
globalThis.accounts[account.Name] = account;
|
|
});
|
|
});
|