Skip to content

Commit

Permalink
test(amd-extra): add test case for passing context meta url as module…
Browse files Browse the repository at this point in the history
….uri
  • Loading branch information
jackw committed Apr 21, 2024
1 parent 6979a11 commit 5cde0bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/browser/amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ suite('AMD tests', function () {
});
});

test('Has access to module.uri (context meta)', function () {
return System.import('fixtures/amd-module-meta.js').then(function (m) {
assert.ok(m.default);
assert.equal(m.default.uri, baseURL+'fixtures/browser/amd-module-meta.js');
});
});

test('Throws an error when define() is called incorrectly', () => {
try {
define("strings are invalid amd modules");
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/browser/amd-module-meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
define(["module"], function (module) {
return {
uri: module.uri,
};
});

0 comments on commit 5cde0bc

Please sign in to comment.