mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Add some tests of importing lazy .html template modules.
This commit is contained in:
7
tools/tests/apps/modules/imports/lazy.html
Normal file
7
tools/tests/apps/modules/imports/lazy.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<body>
|
||||
{{> lazy}}
|
||||
</body>
|
||||
|
||||
<template name="lazy">
|
||||
lazy
|
||||
</template>
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user