-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Refactor: Construct the network controller within each test #17199
Conversation
This depends upon #17126 |
449b30d
to
1c6d8a7
Compare
Builds ready [1c6d8a7]
Page Load Metrics (1186 ± 38 ms)
Bundle size diffs
|
Codecov Report
@@ Coverage Diff @@
## replace-network-controller-test-internal-mocks #17199 +/- ##
===============================================================================
Coverage 59.55% 59.55%
===============================================================================
Files 936 936
Lines 35959 35959
Branches 9213 9213
===============================================================================
Hits 21414 21414
Misses 14545 14545 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions.
The network controller is now constructed within each network controller unit test, rather than in the `beforeEach`. This allows us to customize the constructor options in each test, which some planned future tests will require. The controller is constructed with a helper function that also handles calling `destroy` after each test, even if the test failed. This helps to prevent tests from affecting each other.
1c6d8a7
to
bd6cdd4
Compare
Co-authored-by: Elliot Winkler <[email protected]>
Co-authored-by: Elliot Winkler <[email protected]>
Co-authored-by: Elliot Winkler <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
Builds ready [714402c]
Page Load Metrics (1515 ± 94 ms)
Bundle size diffs
|
The network controller is now constructed within each network controller unit test, rather than in the
beforeEach
. This allows us to customize the constructor options in each test, which some planned future tests will require.The controller is constructed with a helper function that also handles calling
destroy
after each test, even if the test failed. This helps to prevent tests from affecting each other.This relates to #16962
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.