From c6b098e9feecddf27c90830b75ff8c234058fe4b Mon Sep 17 00:00:00 2001 From: matstyler Date: Tue, 9 Jul 2024 12:20:26 +0200 Subject: [PATCH] fix: dependencies issues --- examples/new-dawn/package.json | 2 +- examples/new-dawn/tsconfig.json | 3 ++- pnpm-lock.yaml | 4 ++-- wallets/metamask/test/cypress/addNewAccount.cy.ts | 3 --- wallets/metamask/test/cypress/metamask.cy.ts | 12 ++++++++++++ wallets/metamask/test/unit/prepareExtension.test.ts | 3 ++- 6 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 wallets/metamask/test/cypress/addNewAccount.cy.ts create mode 100644 wallets/metamask/test/cypress/metamask.cy.ts diff --git a/examples/new-dawn/package.json b/examples/new-dawn/package.json index 29fc6a049..4a828a533 100644 --- a/examples/new-dawn/package.json +++ b/examples/new-dawn/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@metamask/test-dapp": "8.1.0", "@types/node": "20.11.17", - "cypress": "13.9.0", + "cypress": "13.13.0", "serve": "14.2.1", "typescript": "5.3.3" } diff --git a/examples/new-dawn/tsconfig.json b/examples/new-dawn/tsconfig.json index ae8e7d4dc..d5fba337f 100644 --- a/examples/new-dawn/tsconfig.json +++ b/examples/new-dawn/tsconfig.json @@ -7,7 +7,8 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, - "skipLibCheck": true + "skipLibCheck": true, + "types": ["cypress"] }, "include": ["test"], "files": ["environment.d.ts"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 54b42776c..5e025fc05 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -79,8 +79,8 @@ importers: specifier: 20.11.17 version: 20.11.17 cypress: - specifier: 13.9.0 - version: 13.9.0 + specifier: 13.13.0 + version: 13.13.0 serve: specifier: 14.2.1 version: 14.2.1 diff --git a/wallets/metamask/test/cypress/addNewAccount.cy.ts b/wallets/metamask/test/cypress/addNewAccount.cy.ts deleted file mode 100644 index 711b10a87..000000000 --- a/wallets/metamask/test/cypress/addNewAccount.cy.ts +++ /dev/null @@ -1,3 +0,0 @@ -it('should add a new accounts', () => { - cy.wait(1000000000) -}) diff --git a/wallets/metamask/test/cypress/metamask.cy.ts b/wallets/metamask/test/cypress/metamask.cy.ts new file mode 100644 index 000000000..b9baa54c1 --- /dev/null +++ b/wallets/metamask/test/cypress/metamask.cy.ts @@ -0,0 +1,12 @@ +it('should connect to ethereum', () => { + cy.window().then((window) => { + // @ts-ignore + window.ethereum + .request({ + method: 'eth_chainId' + }) + .then((currentChainId: string) => { + expect(currentChainId).to.equal('0x1') + }) + }) +}) diff --git a/wallets/metamask/test/unit/prepareExtension.test.ts b/wallets/metamask/test/unit/prepareExtension.test.ts index 9e355b3f1..acda9fa66 100644 --- a/wallets/metamask/test/unit/prepareExtension.test.ts +++ b/wallets/metamask/test/unit/prepareExtension.test.ts @@ -1,6 +1,7 @@ import * as core from '@synthetixio/synpress-cache' import { afterAll, afterEach, describe, expect, it, vi } from 'vitest' -import { DEFAULT_METAMASK_VERSION, EXTENSION_DOWNLOAD_URL, prepareExtension } from '../..' + +import { prepareExtension, DEFAULT_METAMASK_VERSION, EXTENSION_DOWNLOAD_URL } from '../../src/prepareExtension' const MOCK_CACHE_DIR_PATH = 'mockCacheDirPath' const MOCK_EXTENSION_ARCHIVE_PATH = 'mockExtensionArchivePath'