From 929fa0e90e2003ac03bcd5d1686ba12228d65b59 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 2 Jun 2017 16:26:54 -0400 Subject: [PATCH] Test that require("module") returns Module constructor on the client. On the server, require("module") returns Node's native Module constructor, which is not the same as module.constructor in our server JS bundle. --- tools/tests/apps/modules/tests.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/tests/apps/modules/tests.js b/tools/tests/apps/modules/tests.js index 9bc5fcebad..4cbf5f5bb9 100644 --- a/tools/tests/apps/modules/tests.js +++ b/tools/tests/apps/modules/tests.js @@ -266,6 +266,11 @@ describe("native node_modules", () => { require("vm"); require("zlib"); }); + + Meteor.isClient && + it('should return Module from require("module")', () => { + assert.ok(module instanceof require("module")); + }); }); describe("local node_modules", () => {