Skip to content

Commit 5ebd7c4

Browse files
committed
test3?
1 parent d639205 commit 5ebd7c4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

packages/neo4j-driver/test/driver.test.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -394,16 +394,21 @@ describe('#integration driver', () => {
394394

395395
jasmine.objectContaining('')
396396

397-
await expectAsync(session.run('RETURN 1')).toBeRejectedWith(
398-
jasmine.objectContaining({
399-
code: neo4j.error.SERVICE_UNAVAILABLE,
400-
message: jasmine.stringMatching(
401-
`Server at ${sharedNeo4j.hostname}:7687 can't perform routing. Make sure you are connecting to a causal cluster.`
402-
)
403-
})
404-
)
397+
let completed = false
398+
try {
399+
await session.run('RETURN 1')
400+
completed = true
401+
} catch (error) {
402+
expect(error.code).toEqual(neo4j.error.SERVICE_UNAVAILABLE)
403+
expect(error.message).toEqual(
404+
`Server at ${sharedNeo4j.hostname}:7687 can't perform routing. ` +
405+
'Make sure you are connecting to a causal cluster.'
406+
)
407+
} finally {
408+
await session.close()
409+
}
405410

406-
await session.close()
411+
expect(completed).toBe(false)
407412
})
408413

409414
it('should have correct user agent', async () => {

0 commit comments

Comments
 (0)