Skip to content

Commit 71371cb

Browse files
SpiralOutDotEublakeembrey
authored andcommitted
Test bubble sort solution in JS (blakeembrey#185)
1 parent 8eedb7e commit 71371cb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/javascript/bubble-sort.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var expect = require('chai').expect;
2+
var bubble_sort = require('../../solutions/javascript/insertion-sort');
3+
4+
describe('it tests bubble sort function', function(){
5+
var sorted = [1, 2, 3, 4, 5, 6, 7, 8, 9];
6+
var array = [9, 8, 7, 6, 5, 4, 3, 2, 1];
7+
8+
it("sort array: " + sorted, function(){
9+
array = bubble_sort(array);
10+
expect(array).deep.equal(sorted);
11+
})
12+
13+
});

0 commit comments

Comments
 (0)