Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buster-autotest

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buster-autotest - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

.travis.yml

22

lib/buster-autotest.js

@@ -6,2 +6,3 @@ var wt = require("fs-watch-tree");

var path = require("path");
var oi = require("./on-interrupt");

@@ -28,12 +29,16 @@ function throttle(ms, callback, thisp) {

var clearScreen = "\x1b[1;1H\x1b[2J";
function printHeader() {
var now = new Date();
util.puts("\n");
util.puts(now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + " Running tests");
util.puts("``````````````````````");
var time = now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();
util.puts(clearScreen + time + " Running tests");
}
function success(code) {
return code === 0;
}
exports.watch = function (dir, options) {
var running = false;
var failed = false;
options = options || {};

@@ -63,3 +68,3 @@

function runTests(event) {
if (running) return;
if (running) { return; }
running = true;

@@ -84,7 +89,4 @@ findFiles(event, function (files) {

test.on("exit", function (code) {
var currentFailed = !!code;
running = false;
var runAll = failed && !currentFailed;
failed = currentFailed;
if (runAll) { runTests(); }
if (success(code) && files.length > 0) { runTests(); }
});

@@ -100,2 +102,4 @@ });

});
oi.onInterrupt("Running all tests.", run);
};
{
"name": "buster-autotest",
"version": "0.1.1",
"version": "0.2.0",
"description": "Watch files and run buster tests on save",

@@ -21,6 +21,12 @@ "homepage": "http://busterjs.org/docs/autotest",

},
"scripts": {
"test": "./node_modules/buster/bin/buster-test"
},
"dependencies": {
"fs-watch-tree": ">=0.1",
"buster-glob": ">=0.3.1"
"fs-watch-tree": ">=0.2.1",
"buster-glob": ">=0.3.2"
},
"devDependencies": {
"buster": "*"
}
}

@@ -8,5 +8,7 @@ var buster = require("buster");

var glob = require("buster-glob");
var oi = require("../lib/on-interrupt");
buster.testCase("Autotest", {
setUp: function () {
this.stub(oi, "onInterrupt");
var self = this;

@@ -196,3 +198,3 @@ this.stdout = "";

"does not run all tests when passing after passing": function () {
"does not run all tests when failing after passing": function () {
autotest.watch("/some/dir");

@@ -204,3 +206,3 @@ this.emitChange("test/thing-test.js");

this.clock.tick(10);
this.passTests();
this.failTests();

@@ -210,3 +212,3 @@ assert.calledTwice(cp.spawn);

"does not run all tests when failing after passing": function () {
"does not re-run all tests after all passing": function () {
autotest.watch("/some/dir");

@@ -216,5 +218,3 @@ this.emitChange("test/thing-test.js");

this.passTests();
this.emitChange("test/thing-test.js");
this.clock.tick(10);
this.failTests();
this.clock.tick(20);

@@ -221,0 +221,0 @@ assert.calledTwice(cp.spawn);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc