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
{{ message }}
Repository navigation
add test coverage for fetchTokenList('default') bundled token path #438
Currently, fetchTokenList('default') -- the code path that returns the bundled @uniswap/default-token-list when PUBLIC_USE_DEFAULT_TOKENS is true (the default) -- has zero test coverage. The test suite in src/hooks/useTokenLists.test.ts mocks PUBLIC_USE_DEFAULT_TOKENS: false, so this branch is never exercised. This is a problem because the bundled list loads on every default page load, and a major version bump (v13 to v18 in #434) can silently change the data shape with no automated detection.
Expected outcome
fetchTokenList('default') is covered by at least one test confirming it returns a valid, non-empty TokenList matching the expected schema.
Acceptance criteria
fetchTokenList('default') is called in a test without mocking @uniswap/default-token-list away
The test asserts the result has a non-empty tokens array and that entries conform to tokenSchema
Existing tests remain unaffected
Technical notes
fetchTokenList('default') returns defaultTokens as TokenList directly from src/hooks/useTokenLists.ts (no network call, no async). The existing test file mocks both @/src/constants/tokenLists and PUBLIC_USE_DEFAULT_TOKENS: false -- the new test should bypass those or set PUBLIC_USE_DEFAULT_TOKENS: true and avoid mocking the token list module.
Use the superpowers:test-driven-development skill when implementing.
Activity
test: add coverage for fetchTokenList('default') bundled token path