Skip to content

Commit

Permalink
Uses only tinytap as a dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcr committed Jul 22, 2014
1 parent 9b46660 commit 39d5a59
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"test": "tinytap -e 'tessel run {} ${ACCEL_PORT}' test/*.js"
},
"dependencies": {
"sync-queue": "0.0.1",
"tinytap": "^0.1.0",
"ttt": "^1.0.3"
"sync-queue": "0.0.1"
},
"hardware": {
"./examples": false
Expand All @@ -19,6 +17,6 @@
"license": "MIT",
"devDependencies": {
"async": "^0.9.0",
"tinytap": "^0.1.0"
"tinytap": "^0.2.0"
}
}
4 changes: 2 additions & 2 deletions test/apiTest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var test = require('ttt');
var test = require('tinytap');

var assert = require('assert');
var async = require('async');
Expand All @@ -9,7 +9,7 @@ var portname = process.argv[2] || 'A';
var requireTime = new Date(milliseconds);
var accel;

console.log('1..42')
test.count(42);

async.series([
// Test connecting
Expand Down
24 changes: 13 additions & 11 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
/* test rig */ var t = 1, tmax = 5
function ok (a, d) { console.log(a ? 'ok ' + (t++) + ' -' : 'not ok ' + (t++) + ' -', d); }
console.log(t + '..' + tmax);

/* script */

var test = require('tinytap');
var tessel = require('tessel');
var accel = require('../').use(tessel.port[process.argv[2] || 'A']);

accel.on('sample', function (xyz) {
ok(Array.isArray(xyz), 'accelerometer data is array');
ok(xyz.length == 3, 'three samples');
ok(typeof xyz[0] == 'number', 'idx 0 is number');
ok(typeof xyz[1] == 'number', 'idx 1 is number');
ok(typeof xyz[2] == 'number', 'idx 2 is number');
process.exit(0);
test.count(5);

test('sample count', function (t) {
accel.once('sample', function (xyz) {
t.ok(Array.isArray(xyz), 'accelerometer data is array');
t.ok(xyz.length == 3, 'three samples');
t.ok(typeof xyz[0] == 'number', 'idx 0 is number');
t.ok(typeof xyz[1] == 'number', 'idx 1 is number');
t.ok(typeof xyz[2] == 'number', 'idx 2 is number');
t.end();
accel.disable();
});
});

0 comments on commit 39d5a59

Please sign in to comment.