Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.20.1 tests are failing #471

Open
leon-do opened this issue Jan 9, 2024 · 1 comment
Open

3.20.1 tests are failing #471

leon-do opened this issue Jan 9, 2024 · 1 comment

Comments

@leon-do
Copy link

leon-do commented Jan 9, 2024

  • I'm submitting a ...
    [ ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [x] question about how to use this project

  • Summary

I'm having trouble testing the main branch.

Steps
git clone [email protected]:Uniswap/smart-order-router.git
cd smart-order-router
npm install
npm run build
npm run test

Error

Summary of all failing tests
 FAIL  test/unit/providers/token-properties-provider.test.ts (8.714 s)
  ● TokenPropertiesProvider › get token fees by address › real ETH and BITBOY token fee fetch, only BITBOY fetched

    expect(received).toBeDefined()

    Received: undefined

      222 |
      223 |       expect(tokenPropertiesMap[BITBOY.address.toLowerCase()]).toBeDefined();
    > 224 |       expect(tokenPropertiesMap[BITBOY.address.toLowerCase()]?.tokenFeeResult).toBeDefined();
          |                                                                                ^
      225 |       expect(tokenPropertiesMap[BITBOY.address.toLowerCase()]?.tokenValidationResult).toBeDefined();
      226 |       assertExpectedTokenProperties(tokenPropertiesMap[BITBOY.address.toLowerCase()],
      227 |         BITBOY?.buyFeeBps,

      at Object.<anonymous> (test/unit/providers/token-properties-provider.test.ts:224:80)

 FAIL  test/unit/providers/token-fee-fetcher.test.ts
  ● TokenFeeFetcher › Fetch WETH and BITBOY, should only return BITBOY

    expect(received).toBeDefined()

    Received: undefined

      25 |     const tokenFeeMap = await tokenFeeFetcher.fetchFees([WETH9[ChainId.MAINNET]!.address, BITBOY.address])
      26 |     expect(tokenFeeMap).not.toContain(WETH9[ChainId.MAINNET]!.address)
    > 27 |     expect(tokenFeeMap[BITBOY.address]).toBeDefined()
         |                                         ^
      28 |     expect(tokenFeeMap[BITBOY.address]?.buyFeeBps).toEqual(BITBOY.buyFeeBps)
      29 |     expect(tokenFeeMap[BITBOY.address]?.sellFeeBps).toEqual(BITBOY.sellFeeBps)
      30 |   });

      at Object.<anonymous> (test/unit/providers/token-fee-fetcher.test.ts:27:41)

  ● TokenFeeFetcher › Fetch BULLET and BITBOY, should return BOTH

    expect(received).toBeDefined()

    Received: undefined

      32 |   it('Fetch BULLET and BITBOY, should return BOTH', async () => {
      33 |     const tokenFeeMap = await tokenFeeFetcher.fetchFees([BULLET.address, BITBOY.address])
    > 34 |     expect(tokenFeeMap[BULLET.address]).toBeDefined()
         |                                         ^
      35 |     expect(tokenFeeMap[BULLET.address]?.buyFeeBps).toEqual(BULLET.buyFeeBps)
      36 |     expect(tokenFeeMap[BULLET.address]?.sellFeeBps).toEqual(BULLET.sellFeeBps)
      37 |     expect(tokenFeeMap[BITBOY.address]).toBeDefined()

      at Object.<anonymous> (test/unit/providers/token-fee-fetcher.test.ts:34:41)


Test Suites: 2 failed, 1 skipped, 19 passed, 21 of 22 total
Tests:       3 failed, 1 skipped, 171 passed, 175 total
Snapshots:   0 total
Time:        12.267 s
Ran all test suites matching /test\/unit/i.
  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

node version 18

thank you @jsy1218

@anixon604
Copy link

It'll pass if you create a .env file in root and add a JSON_RPC_PROVIDER value.

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

No branches or pull requests

2 participants