mirror of https://github.com/nodejs/node.git
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)v0.7.4-release
parent
fcc38129a3
commit
c4f8f871c9
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue