feat: Add ERC20-like Token

This commit is contained in:
Michael Vines
2018-10-06 11:23:18 -07:00
parent ab2d6c9ede
commit ad2fa3ceaf
10 changed files with 1015 additions and 12 deletions

View File

@ -18,13 +18,15 @@ type RpcResponse = {
export const mockRpc: Array<[string, RpcRequest, RpcResponse]> = [];
// Define DOITLIVE in the environment to test against the real full node
// identified by `url` instead of using the mock
export const mockRpcEnabled = !process.env.DOITLIVE;
// Suppress lint: 'JestMockFn' is not defined
// eslint-disable-next-line no-undef
const mock: JestMockFn<any, any> = jest.fn(
(fetchUrl, fetchOptions) => {
// Define DOITLIVE in the environment to test against the real full node
// identified by `url` instead of using the mock
if (process.env.DOITLIVE) {
if (!mockRpcEnabled) {
console.log(`Note: node-fetch mock is disabled, testing live against ${fetchUrl}`);
return fetch(fetchUrl, fetchOptions);
}