deepestblue / saulabhyaJS

GNU Affero General Public License v3.0
1 stars 0 forks source link

Switch to ES6 Node testing #11

Open deepestblue opened 4 years ago

deepestblue commented 4 years ago

Blocked by https://github.com/orgs/avajs/projects/2 or by https://github.com/qunitjs/qunit/issues/1281

github-actions[bot] commented 4 years ago

Stale issue message

Krinkle commented 3 years ago

@deepestblue Could you elaborate briefly where you are looking to import the QUnit package? It is not generally used as a library, but as a test runner. This means there is generally not a need to import "qunit". I'd like to help unblock you as soon as possible. I suspect https://github.com/qunitjs/qunit/issues/1465 would be all you need, at which point you can run qunit test/ or qunit test/foo.esm etc and it will just work for CJS and ESM test suites alike.

deepestblue commented 3 years ago

@Krinkle thanks for reaching out. Yes, I use QUnit as a test runner through an HTML page that I have to manually open in a browser to run tests. And I want to not have to do that, so that I can use online CI suites. I'm no Node ecosystem expert, but it looks like qunitjs/qunit#1465 is what I need, so I just subscribed to the issue. Thanks!

Krinkle commented 3 years ago

@deepestblue ES6 support for Node.js has been released in QUnit 2.13.

QUnit already worked with ESM imports in the browser, which I see this project already uses 🙂 . As of QUnit 2.13 these can be loaded from the QUnit CLI on Node.js as well, e.g. qunit test/*.mjs. Ping me if you need anything!

Krinkle commented 3 years ago

The QUnit CLI can be called from CI via the test script in package.json.

But, if you're looking for a more advanced setup where the browser variant is tested as well and e.g. with combined code coverage reporting, then this example repo might offer some inspiration.