Skip to content

Commit af34207

Browse files
committed
Add test for observer onError method.
1 parent ec43e43 commit af34207

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/session.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ describe('session', function() {
2222
});
2323
});
2424

25+
it('should call observers onError on error ', function(done) {
26+
// Given
27+
var driver = neo4j.driver("neo4j://localhost");
28+
29+
// When & Then
30+
var records = [];
31+
driver.session().run( "RETURN 1 AS").subscribe( {
32+
onError: function(error) {
33+
expect(error.fields.length).toBe(1);
34+
driver.close();
35+
done();
36+
}
37+
});
38+
});
39+
2540
it('should accept a statement object ', function(done) {
2641
// Given
2742
var driver = neo4j.driver("neo4j://localhost");

0 commit comments

Comments
 (0)