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
When writing tests for our frontend monorepo, follow these principles:
9
+
10
+
## Core Philosophy
11
+
- Test behaviors, not implementations
12
+
- Optimize for confidence, readability, and maintainability
13
+
- Follow the testing pyramid: unit tests > integration tests > E2E tests
14
+
- Reference existing tests for examples of our team's best practices. For example: [useBooleanState.test.ts](mdc:packages/utilities/src/react/useBooleanState.test.ts) [useSwapNetworkNotification.test.ts](mdc:packages/uniswap/src/features/transactions/swap/form/hooks/useSwapNetworkNotification.test.ts)
15
+
16
+
## Test Structure & Patterns
17
+
18
+
### Unit Tests
19
+
- Test individual functions, hooks, and components in isolation
20
+
- Use Jest and React Testing Library/React Native Testing Library
21
+
- Follow Arrange-Act-Assert pattern
22
+
- Mock dependencies appropriately
23
+
- Name tests descriptively: `it('should [behavior] when [condition]')`
24
+
25
+
```typescript
26
+
// Component test example
27
+
test('should display error when form submission fails', async () => {
Search Improvements: Enjoy an improved search algorithm, with more relevant information. Recent history also now includes wallet search results.
5
+
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
6
+
7
+
You can also access the Uniswap Interface from an IPFS gateway.
8
+
**BEWARE**: The Uniswap interface uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as which tokens you have imported.
9
+
**You should always use an IPFS gateway that enforces origin separation**, or our hosted deployment of the latest release at [app.uniswap.org](https://app.uniswap.org).
10
+
Your Uniswap settings are never remembered across different URLs.
'Only logger.debug is allowed in this file. Please handle errors and info logs explicitly using ErrorLog and InfoLog message passing.',
57
+
'Only `logger.debug` is allowed in the content scripts. Please handle errors logs explicitly using `ErrorLog` message passing via `logContentScriptError`.',
55
58
},
56
59
],
57
60
},
58
61
},
62
+
{
63
+
// We override this rule from the base config to allow access to `chrome`
64
+
// in all Extension files except those in the `contentScript` folder.
// You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
7
+
// We don't actually need to use `expo-blur` in the Web App, as we just use CSS; so, we can mock it out.
0 commit comments