Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ignite
GitHub Repository: ignite/cli
Path: blob/main/integration/testdata/tstestrunner/testutil/setup.ts
1007 views
1
import { beforeAll, expect } from "vitest";
2
3
// Make sure that the tests have fetch API support
4
import "isomorphic-unfetch";
5
6
type Account = {
7
Name: string;
8
Address: string;
9
Mnemonic: string;
10
Coins: string[];
11
};
12
13
type GlobalAccounts = {
14
[name: string]: Account;
15
};
16
17
beforeAll(() => {
18
// Initialize required globals
19
globalThis.txApi = process.env.TEST_TX_API || "";
20
globalThis.queryApi = process.env.TEST_QUERY_API || "";
21
22
expect(globalThis.txApi, "TEST_TX_API is required").not.toEqual("");
23
expect(globalThis.queryApi, "TEST_QUERY_API is required").not.toEqual("");
24
25
// Initialize the global accounts
26
globalThis.accounts = <GlobalAccounts>{};
27
28
JSON.parse(process.env.TEST_ACCOUNTS || "[]").forEach((account: Account) => {
29
globalThis.accounts[account.Name] = account;
30
});
31
});
32
33