Skip to content

Commit

Permalink
Fixing unable to require module error while execution specs #94
Browse files Browse the repository at this point in the history
  • Loading branch information
Apoorva-GA committed Jan 11, 2018
1 parent 7d9b733 commit 17a5fdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/req-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Req.prototype.load = function (modname) {
path.join(self.root, "node_modules")
].concat(module.paths.filter(function (p) { return p.indexOf(".gauge") < 0; }));
try {
return m.require(modname);
return modname === path.basename(modname) ? m.require(modname) : m.require(path.join(path.dirname(self.filepath), modname));
} catch (e) {
console.error("Unable to require module '" + modname + "' in " + self.filepath);
console.trace(e.stack);
Expand Down

0 comments on commit 17a5fdb

Please sign in to comment.