From 566edc7d3fa37404258f3f56276fc64ecece8207 Mon Sep 17 00:00:00 2001 From: matstyler Date: Fri, 3 May 2024 16:32:50 +0200 Subject: [PATCH] fix: format --- examples/new-dawn/test/synpress.ts | 2 +- packages/core/src/cli/cliEntrypoint.ts | 4 ++-- .../src/utils/createCacheForWalletSetupFunction.ts | 2 +- packages/test/src/testWithSynpress.ts | 2 +- packages/tsconfig/base.json | 2 +- release/src/index.ts | 4 ++-- wallets/ethereum-wallet-mock/playwright.config.ts | 7 +------ .../src/fixtures/ethereumWalletMockFixtures.ts | 2 +- wallets/metamask/playwright.config.ts | 7 +------ wallets/metamask/src/fixtures/metaMaskFixtures.ts | 12 ++++++------ wallets/metamask/test/e2e/importWallet.spec.ts | 2 +- 11 files changed, 18 insertions(+), 28 deletions(-) diff --git a/examples/new-dawn/test/synpress.ts b/examples/new-dawn/test/synpress.ts index e8a53922d..954746f17 100644 --- a/examples/new-dawn/test/synpress.ts +++ b/examples/new-dawn/test/synpress.ts @@ -1,4 +1,4 @@ +import { metaMaskFixtures, testWithSynpress } from '@synthetixio/synpress' import connectedSetup from './wallet-setup/connected.setup' -import { testWithSynpress, metaMaskFixtures } from '@synthetixio/synpress' export default testWithSynpress(metaMaskFixtures(connectedSetup)) diff --git a/packages/core/src/cli/cliEntrypoint.ts b/packages/core/src/cli/cliEntrypoint.ts index 2b6060912..9851573f4 100644 --- a/packages/core/src/cli/cliEntrypoint.ts +++ b/packages/core/src/cli/cliEntrypoint.ts @@ -42,12 +42,12 @@ export const cliEntrypoint = async () => { const flags: CliFlags = program.opts() if (flags.headless) { - process.env['HEADLESS'] = true + process.env.HEADLESS = true } if (flags.debug) { console.log('[DEBUG] Running with the following options:') - console.log({ cacheDir: walletSetupDir, ...flags, headless: Boolean(process.env['HEADLESS']) ?? false }, '\n') + console.log({ cacheDir: walletSetupDir, ...flags, headless: Boolean(process.env.HEADLESS) ?? false }, '\n') } if (os.platform() === 'win32') { diff --git a/packages/core/src/utils/createCacheForWalletSetupFunction.ts b/packages/core/src/utils/createCacheForWalletSetupFunction.ts index bfd082dbd..021bbbe07 100644 --- a/packages/core/src/utils/createCacheForWalletSetupFunction.ts +++ b/packages/core/src/utils/createCacheForWalletSetupFunction.ts @@ -14,7 +14,7 @@ export async function createCacheForWalletSetupFunction( // TODO: Extract & Make a constant. const browserArgs = [`--disable-extensions-except=${extensionPath}`, `--load-extension=${extensionPath}`] - if (process.env['HEADLESS']) { + if (process.env.HEADLESS) { browserArgs.push('--headless=new') } diff --git a/packages/test/src/testWithSynpress.ts b/packages/test/src/testWithSynpress.ts index fc5278384..498a8a58e 100644 --- a/packages/test/src/testWithSynpress.ts +++ b/packages/test/src/testWithSynpress.ts @@ -1,5 +1,5 @@ import type { Fixtures, TestType } from '@playwright/test' -import { test as base, mergeTests } from '@playwright/test' +import { mergeTests, test as base } from '@playwright/test' export default function testWithSynpress( customFixtures: TestType diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.json index fc85922e5..b322b6042 100644 --- a/packages/tsconfig/base.json +++ b/packages/tsconfig/base.json @@ -21,7 +21,7 @@ "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, + "noPropertyAccessFromIndexSignature": false, "esModuleInterop": true, "skipLibCheck": true, diff --git a/release/src/index.ts b/release/src/index.ts index 2b115feac..2282659a6 100644 --- a/release/src/index.ts +++ b/release/src/index.ts @@ -1,7 +1,7 @@ +import { EthereumWalletMock, ethereumWalletMockFixtures } from '@synthetixio/ethereum-wallet-mock' import { defineWalletSetup } from '@synthetixio/synpress-core' -import { testWithSynpress } from '@synthetixio/synpress-test' import { MetaMask, getExtensionId, metaMaskFixtures } from '@synthetixio/synpress-metamask' -import { EthereumWalletMock, ethereumWalletMockFixtures } from '@synthetixio/ethereum-wallet-mock' +import { testWithSynpress } from '@synthetixio/synpress-test' export { // Framework fixtures diff --git a/wallets/ethereum-wallet-mock/playwright.config.ts b/wallets/ethereum-wallet-mock/playwright.config.ts index 2bd77926c..0994ed0a0 100644 --- a/wallets/ethereum-wallet-mock/playwright.config.ts +++ b/wallets/ethereum-wallet-mock/playwright.config.ts @@ -26,12 +26,7 @@ export default defineConfig({ // Concise 'dot' for CI, default 'html' when running locally. // See https://playwright.dev/docs/test-reporters. reporter: process.env.CI - ? [ - [ - 'html', - { open: 'never', outputFolder: `playwright-report-${process.env['HEADLESS'] ? 'headless' : 'headful'}` } - ] - ] + ? [['html', { open: 'never', outputFolder: `playwright-report-${process.env.HEADLESS ? 'headless' : 'headful'}` }]] : 'html', // Shared settings for all the projects below. diff --git a/wallets/ethereum-wallet-mock/src/fixtures/ethereumWalletMockFixtures.ts b/wallets/ethereum-wallet-mock/src/fixtures/ethereumWalletMockFixtures.ts index 905373f07..e42915780 100644 --- a/wallets/ethereum-wallet-mock/src/fixtures/ethereumWalletMockFixtures.ts +++ b/wallets/ethereum-wallet-mock/src/fixtures/ethereumWalletMockFixtures.ts @@ -2,7 +2,7 @@ import { readFileSync } from 'fs' import { createRequire } from 'node:module' import { test as base } from '@playwright/test' import { EthereumWalletMock } from '../EthereumWalletMock' -import { mockEthereum, SEED_PHRASE } from '../utils' +import { SEED_PHRASE, mockEthereum } from '../utils' export const ANVIL_CHAIN_ID = 31337 export const ANVIL_URL_URL = 'http://anvil:5000' diff --git a/wallets/metamask/playwright.config.ts b/wallets/metamask/playwright.config.ts index 2bd77926c..0994ed0a0 100644 --- a/wallets/metamask/playwright.config.ts +++ b/wallets/metamask/playwright.config.ts @@ -26,12 +26,7 @@ export default defineConfig({ // Concise 'dot' for CI, default 'html' when running locally. // See https://playwright.dev/docs/test-reporters. reporter: process.env.CI - ? [ - [ - 'html', - { open: 'never', outputFolder: `playwright-report-${process.env['HEADLESS'] ? 'headless' : 'headful'}` } - ] - ] + ? [['html', { open: 'never', outputFolder: `playwright-report-${process.env.HEADLESS ? 'headless' : 'headful'}` }]] : 'html', // Shared settings for all the projects below. diff --git a/wallets/metamask/src/fixtures/metaMaskFixtures.ts b/wallets/metamask/src/fixtures/metaMaskFixtures.ts index 96199bf2a..9b100ce6a 100644 --- a/wallets/metamask/src/fixtures/metaMaskFixtures.ts +++ b/wallets/metamask/src/fixtures/metaMaskFixtures.ts @@ -1,6 +1,7 @@ -import { MetaMask, unlockForFixture, getExtensionId, prepareExtension } from '../../src' +import { MetaMask, getExtensionId, prepareExtension, unlockForFixture } from '../../src' -import { chromium, type Page } from '@playwright/test' +import path from 'node:path' +import { type Page, chromium } from '@playwright/test' import { test as base } from '@playwright/test' import { CACHE_DIR_NAME, @@ -8,9 +9,8 @@ import { defineWalletSetup, removeTempContextDir } from '@synthetixio/synpress-core' -import path from 'node:path' -import fs from 'fs-extra' import { type Anvil, type CreateAnvilOptions, createPool } from '@viem/anvil' +import fs from 'fs-extra' type MetaMaskFixtures = { _contextPath: string @@ -52,7 +52,7 @@ export const metaMaskFixtures = (walletSetup: ReturnType 0) { @@ -63,7 +63,7 @@ export const metaMaskFixtures = (walletSetup: ReturnType