Skip to content

fix: Update Metamask setup#27

Open
milosh86 wants to merge 2 commits intomainfrom
fix-metamsk-setup
Open

fix: Update Metamask setup#27
milosh86 wants to merge 2 commits intomainfrom
fix-metamsk-setup

Conversation

@milosh86
Copy link

  • fix metamask setup and Typescript issues
  • simplify it to a sequential execution for now

Signed-off-by: Milos Dzepina <milos@aragon.org>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes MetaMask setup and TypeScript issues by adding error handling and simplifying test execution to sequential mode.

  • Added error handling and validation for MetaMask wallet setup
  • Changed Network enum to const assertion pattern for better TypeScript compatibility
  • Configured Playwright to run tests sequentially instead of in parallel

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/setup/wallet.setup.ts Added environment variable validation and error handling for MetaMask wallet import
src/helpers/types/enum/network.ts Converted enum to const assertion pattern with proper typing
playwright.config.ts Disabled parallel execution and forced sequential test runs with headless mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

try {
await metamask.importWallet(SEED_PHRASE);
} catch (error) {
throw new Error(`Failed to import MetaMask wallet: ${String(error)}`);
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message could be more helpful by preserving the original error structure. Consider using error instanceof Error ? error.message : String(error) to get the actual error message instead of converting the entire error object to string.

Suggested change
throw new Error(`Failed to import MetaMask wallet: ${String(error)}`);
throw new Error(`Failed to import MetaMask wallet: ${error instanceof Error ? error.message : String(error)}`);

Copilot uses AI. Check for mistakes.
timeout: 120_000,
use: {
baseURL,
headless: true,
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The headless: true setting is duplicated between the global use configuration and the project-specific configuration. Remove the duplication by keeping it only in the global use section since project settings inherit from global settings.

Copilot uses AI. Check for mistakes.
use: {
...devices['Desktop Chrome'],
baseURL,
headless: true,
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The headless: true setting is duplicated between the global use configuration and the project-specific configuration. Remove the duplication by keeping it only in the global use section since project settings inherit from global settings.

Suggested change
headless: true,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants