buster-autotest
Advanced tools
Comparing version 0.2.1 to 0.3.0
var wt = require("fs-watch-tree"); | ||
var cp = require("child_process"); | ||
var util = require("util"); | ||
var glob = require("buster-glob"); | ||
var glob = require("multi-glob"); | ||
var path = require("path"); | ||
@@ -18,7 +18,8 @@ var oi = require("./on-interrupt"); | ||
function addTestOption(argv, files) { | ||
for (var i = 0, l = argv.length; i < l; ++i) { | ||
var i, l, args; | ||
for (i = 0, l = argv.length; i < l; ++i) { | ||
if (argv[i] === "-t" || argv[i] === "--tests") { | ||
var arguments = argv.slice(); | ||
arguments[i + 1] += "," + files.join(","); | ||
return arguments; | ||
args = argv.slice(); | ||
args[i + 1] += "," + files.join(","); | ||
return args; | ||
} | ||
@@ -71,3 +72,4 @@ } | ||
printHeader(); | ||
var test = cp.spawn("buster-test", prepareOptions(files)); | ||
var command = (options.cmd || "buster-test").replace(/([^\\]) /g, "$1\\ "); | ||
var test = cp.spawn(command, prepareOptions(files)); | ||
@@ -74,0 +76,0 @@ var cancel = throttle(1000, function () { |
{ | ||
"name": "buster-autotest", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Watch files and run buster tests on save", | ||
@@ -11,9 +11,14 @@ "homepage": "http://busterjs.org/docs/autotest", | ||
}, | ||
"contributors": [ | ||
{ | ||
"name": "August Lilleaas", | ||
"email": "august.lilleaas@gmail.com", | ||
"url": "http://augustl.com" | ||
} | ||
], | ||
"contributors": [{ | ||
"name": "Christian Johansen", | ||
"email": "christian@cjohansen.no", | ||
"url": "http://cjohansen.no" | ||
}, { | ||
"name": "Magnar Sveen", | ||
"email": "magnars@gmail.com" | ||
}, { | ||
"name": "Stein Magnus Jodal", | ||
"email": "stein.magnus@jodal.no", | ||
"url": "http://jodal.no" | ||
}], | ||
"main": "./lib/buster-autotest", | ||
@@ -25,16 +30,11 @@ "repository": { | ||
"scripts": { | ||
"test": "./node_modules/buster/bin/buster-test" | ||
"test": "node run-tests.js" | ||
}, | ||
"dependencies": { | ||
"fs-watch-tree": "=0.2.2", | ||
"buster-glob": "=0.3.3" | ||
"fs-watch-tree": ">=0.2.1", | ||
"multi-glob": "=0.4.0" | ||
}, | ||
"devDependencies": { | ||
"buster": "*" | ||
}, | ||
"readme": "# buster-autotest\n\n[![Build status](https://secure.travis-ci.org/busterjs/buster-autotest.png?branch=master)](http://travis-ci.org/busterjs/buster-autotest)\n\nA simple autotest CLI for Buster.JS\n", | ||
"readmeFilename": "Readme.md", | ||
"bugs": { | ||
"url": "https://github.com/busterjs/buster-autotest/issues" | ||
"buster-node": ">=0.1" | ||
} | ||
} |
@@ -1,2 +0,4 @@ | ||
var buster = require("buster"); | ||
var buster = require("buster-node"); | ||
var assert = buster.referee.assert; | ||
var refute = buster.referee.refute; | ||
var autotest = require("../lib/buster-autotest"); | ||
@@ -7,4 +9,5 @@ var wt = require("fs-watch-tree"); | ||
var path = require("path"); | ||
var glob = require("buster-glob"); | ||
var glob = require("multi-glob"); | ||
var oi = require("../lib/on-interrupt"); | ||
var events = require("events"); | ||
@@ -20,6 +23,6 @@ buster.testCase("Autotest", { | ||
this.stub(cp, "spawn", function () { | ||
var process = buster.eventEmitter.create(); | ||
var process = new events.EventEmitter(); | ||
process.kill = self.spy(); | ||
process.stdout = buster.eventEmitter.create(); | ||
process.stderr = buster.eventEmitter.create(); | ||
process.stdout = new events.EventEmitter(); | ||
process.stderr = new events.EventEmitter(); | ||
self.processes.push(process); | ||
@@ -100,3 +103,5 @@ self.process = process; | ||
assert.calledWith( | ||
cp.spawn, "buster-test", ["-t", "file.js,test/thing-test.js"] | ||
cp.spawn, | ||
"buster-test", | ||
["-t", "file.js,test/thing-test.js"] | ||
); | ||
@@ -110,3 +115,5 @@ }, | ||
assert.calledWith( | ||
cp.spawn, "buster-test", ["--tests", "file.js,test/thing-test.js"] | ||
cp.spawn, | ||
"buster-test", | ||
["--tests", "file.js,test/thing-test.js"] | ||
); | ||
@@ -122,3 +129,5 @@ }, | ||
assert.calledWith( | ||
cp.spawn, "buster-test", [ | ||
cp.spawn, | ||
"buster-test", | ||
[ | ||
"-r", | ||
@@ -189,3 +198,3 @@ "specification", | ||
"runs originally selected tests when passing after failing": function () { | ||
"runs originally selected tests when pass after fail": function () { | ||
autotest.watch("/some/dir", { argv: ["-t", "test/boing.js"] }); | ||
@@ -226,3 +235,4 @@ this.emitChange("test/thing-test.js"); | ||
"runs related test files": function () { | ||
glob.glob.yields(null, ["test/buster-autotest-test.js"]); | ||
glob.glob.restore(); | ||
this.stub(glob, "glob").yields(null, ["test/buster-autotest-test.js"]); | ||
autotest.watch(path.join(__dirname, "../")); | ||
@@ -229,0 +239,0 @@ this.emitChange("lib/buster-autotest.js"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15333
12
335
15
2
+ Addedmulti-glob@=0.4.0
+ Addedfs-watch-tree@0.2.5(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.14(transitive)
+ Addedsigmund@1.0.1(transitive)
- Removedbuster-glob@=0.3.3
Updatedfs-watch-tree@>=0.2.1