mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Add a failing test of dynamic imports from user:name packages.
Confirms #8751.
This commit is contained in:
@@ -25,3 +25,4 @@ dispatch:mocha-phantomjs
|
||||
dispatch:mocha-browser
|
||||
lazy-test-package
|
||||
helper-package
|
||||
user:colon-name
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
This package exists to test dynamic imports from packages that are
|
||||
prefixed by a username, and thus have a colon between the username and the
|
||||
package name.
|
||||
@@ -0,0 +1 @@
|
||||
export const name = module.id;
|
||||
@@ -0,0 +1,12 @@
|
||||
Package.describe({
|
||||
name: "user:colon-name",
|
||||
version: "0.0.1",
|
||||
summary: "Package with a colon in its name",
|
||||
git: "https://github.com/meteor/meteor/tree/devel/" +
|
||||
"tools/tests/apps/dynamic-import/packages",
|
||||
documentation: "README.md"
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.use("ecmascript");
|
||||
});
|
||||
@@ -194,6 +194,15 @@ describe("dynamic import(...)", function () {
|
||||
assert.deepEqual(m, {});
|
||||
});
|
||||
});
|
||||
|
||||
it("should work for package names containing colons", () => {
|
||||
import("meteor/user:colon-name/dynamic.js").then(dynamic => {
|
||||
assert.strictEqual(
|
||||
dynamic.name,
|
||||
"/node_modules/meteor/user:colon-name/dynamic.js"
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function maybeClearDynamicImportCache() {
|
||||
|
||||
Reference in New Issue
Block a user