Skip to content

Commit a889150

Browse files
committed
Couple improvements for tests
Increase jasmine timeout for temporal type ITs. Skip connection timeout test with encryption in browser because all tests are executed in a HTTP page by the Karma runner.
1 parent 6f0e8bb commit a889150

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test/v1/session.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import sharedNeo4j from '../internal/shared-neo4j';
2727
import _ from 'lodash';
2828
import {ServerVersion, VERSION_3_1_0} from '../../src/v1/internal/server-version';
2929
import {isString} from '../../src/v1/internal/util';
30+
import testUtils from '../internal/test-utils';
3031

3132
describe('session', () => {
3233

@@ -1176,14 +1177,22 @@ describe('session', () => {
11761177
}
11771178

11781179
function testConnectionTimeout(encrypted, done) {
1180+
if (testUtils.isClient() && encrypted) {
1181+
// skip encrypted test in browser because it runs all tests in a HTTP page
1182+
done();
1183+
return;
1184+
}
1185+
11791186
const boltUri = 'bolt://10.0.0.0'; // use non-routable IP address which never responds
11801187
const config = {encrypted: encrypted, connectionTimeout: 1000};
11811188

11821189
const localDriver = neo4j.driver(boltUri, sharedNeo4j.authToken, config);
11831190
const session = localDriver.session();
11841191
session.run('RETURN 1').then(() => {
1192+
localDriver.close();
11851193
done.fail('Query did not fail');
11861194
}).catch(error => {
1195+
localDriver.close();
11871196
expect(error.code).toEqual(neo4j.error.SERVICE_UNAVAILABLE);
11881197

11891198
// in some environments non-routable address results in immediate 'connection refused' error and connect

test/v1/temporal-types.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('temporal-types', () => {
4646

4747
beforeAll(done => {
4848
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
49-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
49+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
5050

5151
driver = neo4j.driver('bolt://localhost', sharedNeo4j.authToken);
5252
driverWithNativeNumbers = neo4j.driver('bolt://localhost', sharedNeo4j.authToken, {disableLosslessIntegers: true});

0 commit comments

Comments
 (0)