From c4f8f871c98fb689826ac8d763e8713739dc042b Mon Sep 17 00:00:00 2001 From: Anders Conbere Date: Wed, 1 Dec 2010 14:31:20 -0800 Subject: [PATCH] adding module tests for .js and bare files Currently the module tests don't cover the cases for when a user requires a file with a request that includes the extension, and for a request to a file with no extensions. ex. require("./a.js") // not tested require("./foo") // (not tested with trying to load a file named ./foo) --- test/simple/test-module-loading.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/simple/test-module-loading.js b/test/simple/test-module-loading.js index bdff4a9d2d6..e03b74e4a83 100644 --- a/test/simple/test-module-loading.js +++ b/test/simple/test-module-loading.js @@ -5,6 +5,14 @@ var path = require('path'), common.debug("load test-module-loading.js"); +// require a file with a request that includes the extension +var a_js = require("../fixtures/a.js"); +assert.equal(42, a_js.number); + +// require a file without any extensions +var foo_no_ext = require("../fixtures/foo"); +assert.equal("ok", foo_no_ext.foo); + var a = require("../fixtures/a"); var c = require("../fixtures/b/c"); var d = require("../fixtures/b/d");