Skip to content

Commit

Permalink
add fetch check
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkmin committed Sep 18, 2023
1 parent 464e82f commit f7cd8c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/viem/src/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ import { createAccount } from "../";
import Test721 from "./Test721.json";
import { expect, beforeEach, describe, test } from "@jest/globals";

// @ts-ignore
let fetch: typeof globalThis.fetch;

if (typeof globalThis?.fetch !== "undefined") {
fetch = globalThis.fetch;
} else {
fetch = require("cross-fetch");
}

// @ts-expect-error
const testCase: typeof test = (...argList) => {
if (!process.env.BANNED_TO_ADDRESS) {
Expand Down

0 comments on commit f7cd8c8

Please sign in to comment.