Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix loading test by absolute path

  • Loading branch information...
commit 4bb808c760465a719b8ff1ae40fb7457221bd6b0 1 parent ae3968c
@5long authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  package.json
  2. +4 −4 src/bin/cli.js
View
2  package.json
@@ -4,7 +4,7 @@
, "bin": {"reut": "./src/bin/cli.js"}
, "description": "REimplemented Unit Test for node.js"
, "dependencies": { "optimist": "~0.2"}
-, "engines": {"node": ">=0.1.103"}
+, "engines": {"node": ">=0.4.0"}
, "homepage": "http://github.com/5long/reut"
, "keywords": ["test", "testing", "unit test", "TDD"]
, "licenses":
View
8 src/bin/cli.js
@@ -4,14 +4,14 @@ var runner = require("../runner")
, async = util.async
, path = require("path")
, optimist = require("optimist")
+ , cwd = process.cwd()
function main() {
var args = extractArgs()
, files = args._.slice()
- , cwd = process.cwd()
async.map(files, function(file) {
- loadAndRun(path.join(cwd, file), this)
+ loadAndRun(file, this)
}, function(err) {
if (err) throw err
runner.run({shuffle: args.shuffle}, function(err, results) {
@@ -22,8 +22,8 @@ function main() {
}
function loadAndRun(filename, cb) {
- var modName = filename.replace(/\.(?:js|node)$/, "")
- require(modName)
+ filename = path.resolve(cwd, filename)
+ require(filename)
cb(null)
}
Please sign in to comment.
Something went wrong with that request. Please try again.