Browse Source

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
Anders Conbere 14 years ago
committed by Ryan Dahl
parent
commit
c4f8f871c9
  1. 8
      test/simple/test-module-loading.js

8
test/simple/test-module-loading.js

@ -5,6 +5,14 @@ var path = require('path'),
common.debug("load test-module-loading.js"); 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 a = require("../fixtures/a");
var c = require("../fixtures/b/c"); var c = require("../fixtures/b/c");
var d = require("../fixtures/b/d"); var d = require("../fixtures/b/d");

Loading…
Cancel
Save