Unbundle core classes from the tests JavaScript bundle.
Review Request #13337 — Created Oct. 12, 2023 and submitted
Many of our new TypeScript-based JavaScript unit tests were doing
relative imports for the modules they want to test. This caused the
tests to test against a copy of the core classes normally exported to
theRB
namespace, which meant:
We weren't testing the actual exposed classes, which could cause
state issues or duplicate initialization.We were ballooning the size of our tests JavaScript bundle and the
memory/load time for the page.We weren't in a position to catch whether we properly exported a
class toRB
when converting TypeScript code.Fortunately, issues #1 and #3 haven't been a problem so far, but it's
too easy for something to go wrong there. We want to be testing the same
code and state that the Review Board pages would be loading themselves.This change updates all the imports in the unit tests to import from the
exported bundles.
All JavaScript unit tests pass.
Verified that the resulting bundle file only had unit test code in it.
Summary | ID |
---|---|
ef27472e59f3f9f3698e25477eb8520d78d87aae |
Description | From | Last Updated |
---|---|---|
These can be merged. |
maubin |
- Change Summary:
-
Merged two import blocks.
- Commits:
-
Summary ID 2b3ef601ba06fe169565c0090f860e96bf2a0f1f ef27472e59f3f9f3698e25477eb8520d78d87aae - Diff:
-
Revision 2 (+142 -104)