Add a failing test of dynamic imports from user:name packages.

Confirms #8751.
This commit is contained in:
Ben Newman
2017-06-02 10:45:10 -04:00
parent c4730c6af5
commit a2aec7becf
5 changed files with 26 additions and 0 deletions

View File

@@ -25,3 +25,4 @@ dispatch:mocha-phantomjs
dispatch:mocha-browser
lazy-test-package
helper-package
user:colon-name

View File

@@ -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.

View File

@@ -0,0 +1 @@
export const name = module.id;

View File

@@ -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");
});

View File

@@ -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() {