Skip to content

Commit

Permalink
Update getChainId test to use config.overload
Browse files Browse the repository at this point in the history
  • Loading branch information
huyndo committed Dec 5, 2022
1 parent b721684 commit c41dc1f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/fcl/src/utils/getChainId.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import {config} from "@onflow/config"
import assert from "assert"
import { getChainId } from "./getChainId"
import {getChainId} from "./getChainId"

describe("getChainId", () => {

it("getChainId assuming it's already in config", async () => {
config.put("flow.network.default", "testnet")
let network

await config.overload({"flow.network.default": "testnet"}, async () => {
network = await getChainId()
})

const network = await getChainId()
assert.equal("testnet", network)
assert.equal(network, "testnet")
})
})

0 comments on commit c41dc1f

Please sign in to comment.