diff --git a/src/export.js b/src/export.js index e0bd6da3b..c1a0e228a 100644 --- a/src/export.js +++ b/src/export.js @@ -21,6 +21,11 @@ export default function exportQUnit (QUnit) { // For consistency with CommonJS environments' exports module.exports.QUnit = QUnit; + // For allowing ESM imports + module.exports.todo = QUnit.todo; + module.exports.skip = QUnit.skip; + module.exports.test = QUnit.test; + module.exports.module = QUnit.module; exportedModule = true; } diff --git a/test/es2018/explicit-imports.mjs b/test/es2018/explicit-imports.mjs new file mode 100644 index 000000000..0e77de554 --- /dev/null +++ b/test/es2018/explicit-imports.mjs @@ -0,0 +1,7 @@ +import { module, test } from 'qunit'; + +module('ESM test suite', () => { + test('imports worked', function (assert) { + assert.true(true, 'an assertion'); + }); +});