qunitjs / qunit

🔮 An easy-to-use JavaScript unit testing framework.
https://qunitjs.com
MIT License
4.02k stars 783 forks source link

Can we move this repo to a monorepo so we can more accurately test different usage scenarios? #1726

Open NullVoxPopuli opened 9 months ago

NullVoxPopuli commented 9 months ago

In replying to: https://github.com/qunitjs/qunit/issues/1724 I was thinking about how to add a test to this repo such that we could simulate ESM node projects and ESM browser projects, and those style of projects are just different enough where it'd be easier if they had their own package.json, which works best in a monorepo.

what are the maintainers' thoughts on this?

thanks!!

Krinkle commented 3 weeks ago

QUnit is portable/isomorphic JavaScript directly usable in browsers, Node.js (plain), and other contexts. As such this "package" does require testing of both its CJS and (soon) ESM distro, and in both browser and Node.js enviornments.

The QUnit CLI for Node.js can and should be more cleanly separated indeed. While this package does contain both core and the CLI (and used by people for either/both purposes), the "npm" package I think makes sense to separate from the core release that we publish on the CDN.

I'm also working on a side project, a radically simple minimal dependency-free browser CLI, which I'd like to publish through the QUnit repo (i.e. to replace Karma Runner; competing somewhat with Testem, Airtap, TestCase, testee). It'd be good to clean stuff up a bit before committing that.

As a first step on the source, I'm thinking at least the following:

The "test" directory is where most of the mess exists today. We currently test Node.js support of core primarily via the CLI. We can keep using our own CLI to (also) run those same tests, but we should separate it from tests specifically about CLI code (which e.g. wouldn't pass if run standalone). And we could potentially expand the test matrix and actually run the majority of these also on standalone. Right now in Gruntfile#test-on-node we test only a small subset standalone.