Unbundle core classes from the tests JavaScript bundle.

Review Request #23 — Created Nov. 13, 2023 and updated


Review Board


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
the `RB` namespace, which meant:

1. We weren't testing the actual exposed classes, which could cause
   state issues or duplicate initialization.

2. We were ballooning the size of our tests JavaScript bundle and the
   memory/load time for the page.

3. We weren't in a position to catch whether we properly exported a
   class to `RB` 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.

Testing Done:
All JavaScript unit tests pass.

Verified that the resulting bundle file only had unit test code in it.

Reviewed at https://reviews.reviewboard.org/r/13337/

Description From Last Updated

Bold remark


some snarky remark on code style

  2. more smarty-pants comments

  3. Show all issues

    Bold remark

  4. Show all issues
    some snarky remark on code style