Commit f0d8f8b2 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

test(e2e): mock uniswap token lists from ipfs (#6511)

* test(e2e): mock uniswap token lists from ipfs

* test(e2e): correctly intercept
parent ff080aa9
...@@ -9,6 +9,7 @@ import '@cypress/code-coverage/support' ...@@ -9,6 +9,7 @@ import '@cypress/code-coverage/support'
import 'cypress-hardhat/lib/browser' import 'cypress-hardhat/lib/browser'
import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge' import { Eip1193Bridge } from '@ethersproject/experimental/lib/eip1193-bridge'
import TokenListJSON from '@uniswap/default-token-list'
import assert from 'assert' import assert from 'assert'
import { FeatureFlag } from '../../src/featureFlags/flags/featureFlags' import { FeatureFlag } from '../../src/featureFlags/flags/featureFlags'
...@@ -115,6 +116,10 @@ beforeEach(() => { ...@@ -115,6 +116,10 @@ beforeEach(() => {
}) })
) )
}) })
// Mock our own token list responses to avoid the latency of IPFS.
.intercept('https://gateway.ipfs.io/ipns/tokens.uniswap.org', TokenListJSON)
.intercept('https://gateway.ipfs.io/ipns/extendedtokens.uniswap.org', { statusCode: 201, body: { tokens: [] } })
.intercept('https://gateway.ipfs.io/ipns/unsupportedtokens.uniswap.org', { statusCode: 201, body: { tokens: [] } })
// Reset hardhat between tests to ensure isolation. // Reset hardhat between tests to ensure isolation.
// This resets the fork, as well as options like automine. // This resets the fork, as well as options like automine.
.hardhat() .hardhat()
......
...@@ -5167,6 +5167,11 @@ ...@@ -5167,6 +5167,11 @@
resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-2.2.0.tgz#d85a5c2520f57f4920bd989dfc9f01e1b701a567" resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-2.2.0.tgz#d85a5c2520f57f4920bd989dfc9f01e1b701a567"
integrity sha512-vFPWoGzDjHP4i2l7yLaober/lZMmzOZXXirVF8XNyfNzRxgmYCWKO6SzKtfEUwxpd3/KUebgdK55II4Mnak62A== integrity sha512-vFPWoGzDjHP4i2l7yLaober/lZMmzOZXXirVF8XNyfNzRxgmYCWKO6SzKtfEUwxpd3/KUebgdK55II4Mnak62A==
"@uniswap/default-token-list@^9.4.0":
version "9.4.0"
resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-9.4.0.tgz#60c4d249b3be5d0123480e5a4fd092a1fd10ef0c"
integrity sha512-PsYsEPpFs0CIjWHel2FDPo6T/EkZ+RuH9NfX55FbMbZMTuw9TSQEfl8p1fYt6KAMWi0Zy/Mfqp16y+OiYJyoBA==
"@uniswap/eslint-config@^1.1.1": "@uniswap/eslint-config@^1.1.1":
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/@uniswap/eslint-config/-/eslint-config-1.1.1.tgz#83d2633dad6507ca58bc11c8892035812059488e" resolved "https://registry.yarnpkg.com/@uniswap/eslint-config/-/eslint-config-1.1.1.tgz#83d2633dad6507ca58bc11c8892035812059488e"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment