-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: Convert es2018/esm.mjs to main/modules-esm.mjs
* This introduces the first running of /test/main in an ESM environment, with the addition of `mosjs.mjs`. This uncovered a minor issue in test/main/setTimeout.js which assumed a global `this`, which is undefined in a module context. * This introduces the first covering of standalone Node.js usage in ESM via import().
- Loading branch information
Showing
15 changed files
with
81 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import sum from '../dynamic-import/sum.mjs'; | ||
|
||
QUnit.module('modules [esm]', () => { | ||
QUnit.test('example', assert => { | ||
assert.equal(5, sum(2, 3)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import '../qunit/qunit.js'; | ||
|
||
// Sync with test/index.html | ||
import '../test/main/assert.js'; | ||
import '../test/main/assert-es6.js'; | ||
import '../test/main/assert-step.js'; | ||
// import "../test/main/assert-timeout.js"; // Requires setTimeout | ||
// import "../test/main/async.js"; // Requires setTimeout | ||
import '../test/main/deepEqual.js'; | ||
import '../test/main/diff.js'; | ||
import '../test/main/dump.js'; | ||
import '../test/main/each.js'; | ||
import '../test/main/HtmlReporter.js'; | ||
// import "../test/main/modules.js"; // Requires setTimeout | ||
import '../test/main/modules-es2018.js'; | ||
import '../test/main/modules-esm.mjs'; | ||
import '../test/main/legacy.js'; | ||
import '../test/main/onUncaughtException.js'; | ||
import '../test/main/promise.js'; | ||
import '../test/main/setTimeout.js'; | ||
import '../test/main/stacktrace.js'; | ||
import '../test/main/test.js'; | ||
import '../test/main/utilities.js'; | ||
|
||
QUnit.reporters.tap.init(QUnit); | ||
QUnit.on('runEnd', (suiteEnd) => { | ||
if (suiteEnd.status === 'failed') { | ||
// There is no built-in function for sending a non-zero exit code, | ||
// so throw an uncaught error to make this happen. | ||
throw new Error('Test run has failures.'); | ||
} | ||
}); | ||
|
||
QUnit.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters