Skip to content

Commit

Permalink
fix(test): more fix flaky e2e tests (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrsv authored Jan 31, 2025
1 parent 21ebba4 commit 1032a57
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/mocha/e2e/quote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ describe('quote', function () {
tokenInChainId: 1,
tokenOutAddress: 'USDC',
tokenOutChainId: 1,
amount: await getAmount(1, type, 'ETH', 'USDC', type == 'exactIn' ? '1' : '1000'),
amount: await getAmount(1, type, 'ETH', 'USDC', type == 'exactIn' ? '0.1' : '100'),
type,
recipient: alice.address,
slippageTolerance: LARGE_SLIPPAGE,
Expand Down Expand Up @@ -1075,10 +1075,10 @@ describe('quote', function () {
)

if (type == 'exactIn') {
expect(tokenInBefore.subtract(tokenInAfter).greaterThan(parseAmount('1', Ether.onChain(1)))).to.be.true
expect(tokenInBefore.subtract(tokenInAfter).greaterThan(parseAmount('0.1', Ether.onChain(1)))).to.be.true
checkQuoteToken(tokenOutBefore, tokenOutAfter, CurrencyAmount.fromRawAmount(USDC_MAINNET, data.quote))
} else {
expect(tokenOutAfter.subtract(tokenOutBefore).toExact()).to.equal('1000')
expect(tokenOutAfter.subtract(tokenOutBefore).toExact()).to.equal('100')
}

expect(response.data.hitsCachedRoutes).to.be.true
Expand Down Expand Up @@ -1157,7 +1157,7 @@ describe('quote', function () {
tokenInChainId: 1,
tokenOutAddress: 'USDC',
tokenOutChainId: 1,
amount: await getAmount(1, type, 'WETH', 'USDC', type == 'exactIn' ? '1' : '1000'),
amount: await getAmount(1, type, 'WETH', 'USDC', type == 'exactIn' ? '0.1' : '100'),
type,
recipient: alice.address,
slippageTolerance: LARGE_SLIPPAGE,
Expand Down Expand Up @@ -1191,10 +1191,10 @@ describe('quote', function () {
)

if (type == 'exactIn') {
expect(tokenInBefore.subtract(tokenInAfter).toExact()).to.equal('1')
expect(tokenInBefore.subtract(tokenInAfter).toExact()).to.equal('0.1')
checkQuoteToken(tokenOutBefore, tokenOutAfter, CurrencyAmount.fromRawAmount(USDC_MAINNET, data.quote))
} else {
expect(tokenOutAfter.subtract(tokenOutBefore).toExact()).to.equal('1000')
expect(tokenOutAfter.subtract(tokenOutBefore).toExact()).to.equal('100')
checkQuoteToken(tokenInBefore, tokenInAfter, CurrencyAmount.fromRawAmount(WETH9[1]!, data.quote))
}

Expand Down

0 comments on commit 1032a57

Please sign in to comment.