diff --git a/tools/tests/apps/modules/imports/lazy.html b/tools/tests/apps/modules/imports/lazy.html new file mode 100644 index 0000000000..df3233bbc2 --- /dev/null +++ b/tools/tests/apps/modules/imports/lazy.html @@ -0,0 +1,7 @@ + + {{> lazy}} + + + diff --git a/tools/tests/apps/modules/tests.js b/tools/tests/apps/modules/tests.js index 8c2221d147..f79dc62544 100644 --- a/tools/tests/apps/modules/tests.js +++ b/tools/tests/apps/modules/tests.js @@ -63,6 +63,28 @@ describe("app modules", () => { }); }); +describe("template modules", () => { + Meteor.isClient && + it("should be importable on the client", () => { + assert.strictEqual(typeof Template, "function"); + assert.ok(! _.has(Template, "lazy")); + require("./imports/lazy.html"); + assert.ok(_.has(Template, "lazy")); + assert.ok(Template.lazy instanceof Template); + }); + + Meteor.isServer && + it("should not be importable on the server", () => { + let error; + try { + require("./imports/lazy.html"); + } catch (expected) { + error = expected; + } + assert.ok(error instanceof Error); + }); +}); + describe("native node_modules", () => { Meteor.isServer && it("can be imported on the server", () => {