Skip to content

Use nock to intercept gas call for gas-duck test#10334

Merged
tmashuang merged 2 commits intodevelopfrom
nock-metaswap-gas-price
Feb 2, 2021
Merged

Use nock to intercept gas call for gas-duck test#10334
tmashuang merged 2 commits intodevelopfrom
nock-metaswap-gas-price

Conversation

@tmashuang
Copy link
Copy Markdown
Contributor

Use nock instead of stubbing out the window fetch. My suspicion is that when the test runs the window sometimes wouldn't be intialized/referenced, which could explain the intermittent test failures in those particular tests that call window.fetch.
Using nock allows the call to be intercepted more reliably.

Use nock instead of stubbing out the window fetch. My suspicion is that when the test runs the window sometimes wouldn't be intialized/referenced, which could explain the intermittent test failures in those particular tests that call window.fetch.
Using nock allows the call to be intercepted more reliably.
@tmashuang tmashuang requested a review from a team as a code owner February 2, 2021 18:46
@tmashuang tmashuang requested a review from danjm February 2, 2021 18:46
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2021

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [4034146]
Page Load Metrics (586 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint468759105
domContentLoaded38275958410651
load38476058610651
domInteractive38275958410651

@tmashuang tmashuang changed the title Use nock in to intercept gas call for gas-duck test Use nock to intercept gas call for gas-duck test Feb 2, 2021
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Not sure whether this will fix the intermittent failures, but this looks correct to me, so it's worth a try!

@tmashuang tmashuang merged commit df5f789 into develop Feb 2, 2021
@tmashuang tmashuang deleted the nock-metaswap-gas-price branch February 2, 2021 21:14
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants