You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ❌ Avoid - too broad, may interfere with other requests
462
-
url: 'metamask.io'
475
+
url: 'metamask.io';
463
476
```
464
477
465
478
### 2. Handle Request Bodies Properly
@@ -513,7 +526,6 @@ The mock server automatically tracks and logs:
513
526
-**Request/response timing** information
514
527
-**Feature flag configurations** applied
515
528
516
-
517
529
### Common Debugging Steps
518
530
519
531
1.**Check test output** for mock-related warnings
@@ -542,10 +554,10 @@ Enable debug logging to see mock activity:
542
554
543
555
```typescript
544
556
// ❌ Too specific - might miss query parameters
545
-
url: 'https://api.example.com/data'
557
+
url: 'https://api.example.com/data';
546
558
547
559
// ✅ More flexible pattern
548
-
url:/^https:\/\/api\.example\.com\/data(\?.*)?$/
560
+
url:/^https:\/\/api\.example\.com\/data(\?.*)?$/;
549
561
```
550
562
551
563
### POST Body Validation Failing
@@ -599,4 +611,4 @@ Before submitting tests with custom mocks:
599
611
-[ ] No hardcoded values that should come from constants
600
612
-[ ] Error scenarios mocked when testing error handling
601
613
602
-
The MetaMask Mobile API mocking system provides comprehensive control over network requests, enabling reliable and deterministic E2E tests. By following these patterns, you'll create tests that are both isolated and realistic.
614
+
The MetaMask Mobile API mocking system provides comprehensive control over network requests, enabling reliable and deterministic E2E tests. By following these patterns, you'll create tests that are both isolated and realistic.
@@ -428,4 +443,4 @@ Before using the framework in tests, ensure:
428
443
-[ ] Framework retry mechanisms used instead of manual loops
429
444
-[ ] TypeScript types used for better development experience
430
445
431
-
The MetaMask Mobile E2E framework provides a robust, reliable foundation for writing maintainable end-to-end tests. By following these patterns and avoiding anti-patterns, you'll create tests that are both resilient and easy to understand.
446
+
The MetaMask Mobile E2E framework provides a robust, reliable foundation for writing maintainable end-to-end tests. By following these patterns and avoiding anti-patterns, you'll create tests that are both resilient and easy to understand.
0 commit comments