Skip to content

Commit e980878

Browse files
committed
Fix for flaky tck test
1 parent b0277d2 commit e980878

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

test/internal/tls.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ describe('trust-signed-certificates', function() {
7272
});
7373
});
7474

75-
7675
describe('trust-on-first-use', function() {
7776

7877
var driver;

test/v1/tck/steps/authsteps.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919

2020
var neo4j = require("../../../../lib/v1");
21-
var util = require("./util")
21+
var util = require("./util");
2222

2323
module.exports = function () {
2424

25-
var username = "user"
26-
var password = "password"
25+
var username = "user";
26+
var password = "password";
2727

2828
this.Given(/^a driver is configured with auth enabled and correct password is provided$/, function () {
2929
this.driver.close();
@@ -43,19 +43,21 @@ module.exports = function () {
4343
});
4444

4545
this.Then(/^reading and writing to the database should not be possible$/, function (callback) {
46-
var session = this.driver.session()
46+
this.driver.onError = function(err) {
47+
self.err = err;
48+
};
49+
var session = this.driver.session();
4750
var self = this;
4851
session.run("CREATE (:label1)").then( function( ) {
4952
callback(new Error("Should not be able to run session!"));
5053
}).catch( function(err) {
51-
self.err = err;
5254
callback();
5355
});
5456
});
5557

5658
this.Then(/^a `Protocol Error` is raised$/, function () {
57-
var message = this.err.fields[0].message
58-
var code = this.err.fields[0].code
59+
var message = this.err.fields[0].message;
60+
var code = this.err.fields[0].code;
5961

6062
var expectedStartOfMessage = 'The client is unauthorized due to authentication failure.';
6163
var expectedCode = 'Neo.ClientError.Security.Unauthorized';
@@ -68,4 +70,4 @@ module.exports = function () {
6870
throw new Error("Wrong error code. Expected: '" + expectedCode + "'. Got: '" + code + "'");
6971
}
7072
});
71-
}
73+
};

0 commit comments

Comments
 (0)