Closed cjpillsbury closed 1 year ago
An alternative to building xhr/xhr-mock each time is to check in vendored files for the tests and then have a script we can use to update them. xhr-mock was last updated in 2019 and xhr was last updated in 2020, so, incredibly unlikely they'll change.
This PR updates upchunk tests to run in a browser. To stay consistent with other projects (e.g. Open Elements, Media Chrome we've migrated to using web-test-runner. This also required some updates to tests and test dependencies that were either explicitly designed for node (
nock
vs.xhr-mock
as a replacement) and dependencies that implicitly assumed node without an appropriate build step (e.g.xhr
, which only has a published package using cjs modules).A few callouts:
xhr-mock
(mentioned in code comment for further details).paused
was added to upchunk. This feels like a low risk refactor that is also plausibly useful for non-testing cases.xhr
&xhr-mock
) for compatibility in the new test env currently happens before each run of test. Since these dependencies should never change, they plausibly only need to be built once after a (local/dev) install. Since the build of these modules is very fast, solving this felt like a lower priority.