-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
52 lines (41 loc) · 1.07 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var finch = require('./');
var assert = require('assert');
describe('node-finch', function() {
it('should error with no finch available', function() {
assert.throws(function() {
finch();
}, 'Unable to find Finch');
});
describe('Connected Tests', function() {
var device;
before(function(done) {
console.log('Please connect your Finch within 10 seconds');
this.timeout('15s');
setTimeout(function() {
device = finch();
done();
}, 10 * 1000);
});
describe('.led', function() {
it('should error on wrong args', function() {
assert.throws(function() {
device.led(-10, -10, -10);
});
assert.throws(function() {
device.led(255, 255, 256);
});
assert.throws(function() {
device.led();
});
});
});
describe('.move', function() {
it('should error on wrong args', function() {
device.move(0, 0);
});
it('should accept shorthand', function() {
device.move(0, 0);
});
});
});
});