-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.js
34 lines (25 loc) · 981 Bytes
/
tests.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
chai.should();
describe('CamClient', function(){
describe('#listTasks()', function(){
var camClient;
before(function() {
camClient = new CamClient();
// insert test data into database
});
after(function() {
// maybe remove some test data
});
it('should list 2 tasks', function(done){
camClient.listTasks({assignee: "peter"}, 0, 10)
.should.eventually.eql(new Array({taskno: 123, desc: 'write js tests'}, {taskno: 124, desc: 'have interview'})).notify(done);
});
it('should list 0 tasks', function(done){
camClient.listTasks({assignee: "daniel"}, 0, 10)
.should.eventually.eql(new Array()).notify(done);
});
it('should be rejected', function(done){
camClient.listTasks({assignee: "peter"}, -1, 10)
.should.eventually.be.rejected.notify(done);
});
})
});