@@ -40,26 +40,7 @@ const {
40
40
41
41
const { PROTOCOL_ERROR , SESSION_EXPIRED } = error
42
42
43
- describe ( '#integration session' , ( ) => {
44
- let driver
45
- let session
46
- // eslint-disable-next-line no-unused-vars
47
- let protocolVersion
48
-
49
- beforeEach ( async ( ) => {
50
- driver = neo4j . driver (
51
- `bolt://${ sharedNeo4j . hostname } ` ,
52
- sharedNeo4j . authToken
53
- )
54
- session = driver . session ( )
55
-
56
- protocolVersion = await sharedNeo4j . cleanupAndGetProtocolVersion ( driver )
57
- } )
58
-
59
- afterEach ( async ( ) => {
60
- await driver . close ( )
61
- } )
62
-
43
+ describe ( '#unit session' , ( ) => {
63
44
it ( 'close should return promise' , done => {
64
45
const connection = new FakeConnection ( )
65
46
const session = newSessionWithConnection ( connection )
@@ -114,6 +95,27 @@ describe('#integration session', () => {
114
95
done ( )
115
96
} )
116
97
} , 70000 )
98
+ } )
99
+
100
+ describe ( '#integration session' , ( ) => {
101
+ let driver
102
+ let session
103
+ // eslint-disable-next-line no-unused-vars
104
+ let protocolVersion
105
+
106
+ beforeEach ( async ( ) => {
107
+ driver = neo4j . driver (
108
+ `bolt://${ sharedNeo4j . hostname } ` ,
109
+ sharedNeo4j . authToken
110
+ )
111
+ session = driver . session ( )
112
+
113
+ protocolVersion = await sharedNeo4j . cleanupAndGetProtocolVersion ( driver )
114
+ } )
115
+
116
+ afterEach ( async ( ) => {
117
+ await driver . close ( )
118
+ } )
117
119
118
120
it ( 'should be possible to close driver after closing session with failed tx ' , done => {
119
121
const driver = neo4j . driver (
@@ -1194,15 +1196,6 @@ describe('#integration session', () => {
1194
1196
. then ( ( ) => callback ( ) )
1195
1197
}
1196
1198
1197
- function newSessionWithConnection ( connection ) {
1198
- const connectionProvider = new SingleConnectionProvider (
1199
- Promise . resolve ( connection )
1200
- )
1201
- const session = new Session ( { mode : READ , connectionProvider } )
1202
- session . beginTransaction ( ) // force session to acquire new connection
1203
- return session
1204
- }
1205
-
1206
1199
function idleConnectionCount ( driver ) {
1207
1200
const connectionProvider = driver . _connectionProvider
1208
1201
const address = connectionProvider . _address
@@ -1311,3 +1304,12 @@ describe('#integration session', () => {
1311
1304
} )
1312
1305
}
1313
1306
} )
1307
+
1308
+ function newSessionWithConnection ( connection ) {
1309
+ const connectionProvider = new SingleConnectionProvider (
1310
+ Promise . resolve ( connection )
1311
+ )
1312
+ const session = new Session ( { mode : READ , connectionProvider } )
1313
+ session . beginTransaction ( ) // force session to acquire new connection
1314
+ return session
1315
+ }
0 commit comments