diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00e3a3851..47efc59b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,10 +236,9 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 with: version: "nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9" - # NODE_OPTIONS="--experimental-vm-modules" is needed because @viem/anvil uses dynamic imports - name: Run tests run: | - NODE_OPTIONS="--experimental-vm-modules" yarn workspace @celo/celocli test --coverage + yarn workspace @celo/celocli test --coverage - name: Verify that a new account can be created run: | yarn workspace @celo/celocli run celocli account:new diff --git a/packages/cli/package.json b/packages/cli/package.json index 695f6cfe5..ceaedf8a2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -29,7 +29,7 @@ "lint": "yarn run --top-level eslint -c .eslintrc.js ", "prepublish": "", "prepack": "yarn run build && oclif manifest && oclif readme", - "test": "TZ=UTC yarn jest --runInBand --forceExit" + "test": "TZ=UTC NODE_OPTIONS=--experimental-vm-modules yarn jest --runInBand --forceExit" }, "dependencies": { "@celo/abis": "11.0.0", diff --git a/packages/cli/src/test-utils/chain-setup.test.ts b/packages/cli/src/test-utils/chain-setup.test.ts index 1e3a2156c..d4ec0748a 100644 --- a/packages/cli/src/test-utils/chain-setup.test.ts +++ b/packages/cli/src/test-utils/chain-setup.test.ts @@ -1,5 +1,4 @@ import { isCel2 } from '@celo/connect' -import { newKitFromWeb3 } from '@celo/contractkit' import { testWithAnvil } from '@celo/dev-utils/lib/anvil-test' import Web3 from 'web3' import { setupL2 } from './chain-setup' @@ -7,11 +6,9 @@ import { setupL2 } from './chain-setup' testWithAnvil('chain setup', (web3: Web3) => { describe('setupL2()', () => { it('sets up L2 context', async () => { - const kit = newKitFromWeb3(web3) - expect(await isCel2(web3)).toEqual(false) - await setupL2(kit) + await setupL2(web3) expect(await isCel2(web3)).toEqual(true) }) diff --git a/packages/cli/src/test-utils/chain-setup.ts b/packages/cli/src/test-utils/chain-setup.ts index b5e84ffcf..49ca83a72 100644 --- a/packages/cli/src/test-utils/chain-setup.ts +++ b/packages/cli/src/test-utils/chain-setup.ts @@ -141,8 +141,8 @@ export const topUpWithToken = async ( } // TODO remove this once no longer needed -export const setupL2 = async (kit: ContractKit) => { +export const setupL2 = async (web3: Web3) => { // Temporarily deploying any bytecode, so it's just there, // isCel2 should hence return true as it just checks for bytecode existence - await setCode(kit.web3, PROXY_ADMIN_ADDRESS, proxyBytecode) + await setCode(web3, PROXY_ADMIN_ADDRESS, proxyBytecode) } diff --git a/packages/sdk/contractkit/package.json b/packages/sdk/contractkit/package.json index 8c7f35b89..a055100c5 100644 --- a/packages/sdk/contractkit/package.json +++ b/packages/sdk/contractkit/package.json @@ -20,7 +20,7 @@ "clean": "yarn run --top-level tsc -b . --clean", "prepublishOnly": "yarn build", "docs": "yarn run --top-level typedoc", - "test": "yarn run --top-level jest --runInBand --forceExit", + "test": "NODE_OPTIONS=--experimental-vm-modules yarn run --top-level jest --runInBand --forceExit", "lint": "yarn run --top-level eslint -c .eslintrc.js " }, "dependencies": {