qunitjs / qunit

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

QUnit 3.0 Roadmap #1498

Open Krinkle opened 4 years ago

Krinkle commented 4 years ago

In our usual way, QUnit 3.0 will be a trivial release that adds no features, but only removes deprecated functionality and/or changes default settings.

Users should be able to update to the latest QUnit 2.x release and get all the same new capabilities. Anything that passes on the latest QUnit 2.x without warnings must pass on QUnit 3.0. Anything we want to change in QUnit 3.0 should be deprecated or issue warnings on QUnit 2.0 so that users can gradually address these warnings, and then perform an super simple, uneventful, upgrade to QUnit 3.0.

Before QUnit 3 development starts

QUnit 3 development

Notable changes:

Other work:

Other ideas

Krinkle commented 3 years ago

I've added:

Krinkle commented 3 years ago

Another thing, the HTML UI is currently unable to report global failures from before the first test in the UI because the qunit-tests element is created from QUnit.begin() which naturally fires just after the tests have been loaded, not before.

I'd like to address this by having the UI initialise right away instead of waiting for QUnit.begin(). Given how tight some wrappers and integrations are, though, I propose we do this in QUnit 3.0 rather than now.

Krinkle commented 2 years ago

I propose the following for QUnit 3 as well:

  • Remove support for Node.js 10, require Node.js 12+.
NullVoxPopuli commented 1 year ago

may as well add removing node14 by now, too.

but anywho, reason why I came here is --- ESM.

Currently, the qunit package is not valid, and rollup will error if it tries processing imports of qunit. Is this something that we need to wait for QUnit 3 to fix? or can we fix in v2?

Krinkle commented 1 year ago

@NullVoxPopuli That sounds like something we can fix in a minor release.

If I understand correctly, you're looking to import qunit and embed within a larger bundle? I've not tried to do that myself, but in terms of loading it over ESM, that seems to work in both browsers and Node.js. E.g. in browsers await import("https://code.jquery.com/qunit/qunit-2.19.4.js"); results in QUnit being defined, and in Node.js, import('qunit'); returns the QUnit API.

Could you file a bug report with details on where it currently fails?

NullVoxPopuli commented 1 year ago

sounds good: https://github.com/qunitjs/qunit/issues/1724

can we change the whole package to use modern JS? I see IIFE, and non-class usage when it looks like it really wants to be using classes. I'm willing to make PRs, add tests, etc.

and for v3, can we extract non-browser utils to like a @qunit/cli or something?

lifeart commented 2 weeks ago

It will be really handy to have builtin retry as in playwright-test - https://playwright.dev/docs/test-retries Related issue: https://github.com/qunitjs/qunit/issues/1572 Related qunit addon: https://github.com/mrloop/QUnit-retry