Skip to content

Commit

Permalink
Fixes climate tests to work with "npm test" on command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcr committed Jul 22, 2014
1 parent 47b1d20 commit ff0504e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "[email protected]",
"license": "MIT/Apache 2.0",
"devDependencies": {
"tinytap": "~0.0.2",
"tinytap": "^0.1.0",
"ttt": "^1.0.3"
}
}
24 changes: 14 additions & 10 deletions test/event.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
var test = require('tape');
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

/* test rig */
function tap (max) { tap.t = 1; console.log(tap.t + '..' + max); };
function ok (a, d) { console.log(a ? 'ok ' + (tap.t++) + ' -' : 'not ok ' + (tap.t++) + ' -', d); }

tap(1);

var tessel = require('tessel');
var climatelib = require('../');

test('events', function (t) {
t.plan(2);

var climate = climatelib.use(tessel.port['A']);
var port = process.argv[2] || 'A';
var climate = climatelib.use(tessel.port[port]);

climate.on('ready', function () {
t.equal();
t.notEqual();
});
});
climate.on('ready', function () {
ok(true, 'ready event was fired.');
});
5 changes: 4 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
var tessel = require('tessel');
var test = require('ttt');
var port = process.argv[2] || 'A';
var climatelib = require('/..');

var port = process.argv[2] || 'A';
var climate = null;
var TIMEOUT = 10000;

console.log('1..31');

function completionChecker (required, test) {
this.required = required;
this.completed = 0;
Expand Down

0 comments on commit ff0504e

Please sign in to comment.