-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbubblesort.spec.js
More file actions
29 lines (24 loc) · 824 Bytes
/
bubblesort.spec.js
File metadata and controls
29 lines (24 loc) · 824 Bytes
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
describe('Bubble Sort', function(){
it('handles an empty array', function(){
expect( bubbleSort([]) ).toEqual( [] );
});
it('handles a single items', function(){
expect( bubbleSort([3]) ).toEqual( [3] );
});
it('handles multiple items', function(){
expect( bubbleSort([3,2,5,1,4]) ).toEqual( [1,2,3,4,5] );
});
it('handles already sorted array', function(){
expect( bubbleSort([1,2,3,4,5]) ).toEqual( [1,2,3,4,5] );
});
});
// it("calls the function argument a maximum of two times", function(){
// var returnTen = jasmine.createSpy('returnTen', function(){
// return 10;
// });
// var returnVal = twice(returnTen);
// returnVal();
// returnVal();
// returnVal();
// expect(returnTen.calls.count()).toEqual(2);
// });