Skip to content

Commit 911d563

Browse files
committed
Add basic tests for dijkstra
1 parent ecd99c9 commit 911d563

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var dijkstra =
2+
require('../../../src/graphs/shortest-path/dijkstra').dijkstra;
3+
4+
describe('dijkstra', function () {
5+
'use strict';
6+
it('should define a function', function () {
7+
expect(dijkstra).toBeDefined();
8+
expect(typeof dijkstra).toBe('function');
9+
});
10+
11+
it('should work with empty graph', function () {
12+
expect(dijkstra(0, 0, [])).toBe(Infinity);
13+
});
14+
15+
});

0 commit comments

Comments
 (0)