muxinc / upchunk

Uploads Chunks! Takes big files, splits them up, then uploads each one with care (and PUT requests).
MIT License
329 stars 46 forks source link

Test/browser env #94

Closed cjpillsbury closed 1 year ago

cjpillsbury commented 1 year ago

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:

gkatsev commented 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.