[Important] Made "fake-xml-http-request" universal for deno, node.js & browser #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @xg-wang ,
Few days ago I've released QUnitX, a universal test runner for JavaScript runtimes. This is a showcase of this test library/framework in action. QUnitX utilizes the default test runner of node.js and deno while having 0 dependencies, it leverages the new conditional import/export feature of node.js.
I was able to rewrite the test suite and implementation while making 0 changes to the actual implementation of the original file. I've divided changes into separate commits so I suggest going over the changes commit-by-commit.
Changes:
@xmldom/xmldomnpm package that is only imported as a dependency on deno & node.js imports for the DOMParser/XMLParser since these runtimes don't have it. In other words this dependency is not included in the distributed file when bundled by browser bundlers likeesbuild, whentargetisn'tnodeordeno.qunitxinstead ofqunit, you'll see changes here are mainly cosmetic. I've used deno formatter to format these files.I could implement a dockerized CI for this, but then I would need to add secrets to be able to deploy them to some registry & re-use containers during CI builds, so instead I've set up a very fast/cached nix based deterministic CI using github actions. CI builds could be near-instant had magic-nix-cache-action cached dependencies on https://cache.nixos.org . You can also run the tests locally, please have a look at changes and let me know what you think, cheers!