-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtest.js
26 lines (23 loc) · 891 Bytes
/
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
var should = require("should");
var Swipe = require('./card-swipe.js');
describe('CreditSwipe', function(){
it('can detect a card swipe', function(done){
var scanner = new Swipe.Scanner();
var result;
new Swipe({
scanner : scanner,
onScan : function(swipeData){
swipeData.should.have.property('account');
swipeData.should.have.property('name');
swipeData.should.have.property('exp_year');
swipeData.should.have.property('exp_month');
swipeData.should.have.property('expiration');
swipeData.should.have.property('track_one');
swipeData.should.have.property('track_two');
swipeData.should.have.property('type');
done();
}
});
Swipe.fake(scanner);
});
});