Skip to content

Commit f43e418

Browse files
committed
test3?
1 parent 1111b96 commit f43e418

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
@@ -370,16 +370,21 @@ describe('#integration driver', () => {
370370

371371
jasmine.objectContaining('')
372372

373-
await expectAsync(session.run('RETURN 1')).toBeRejectedWith(
374-
jasmine.objectContaining({
375-
code: neo4j.error.SERVICE_UNAVAILABLE,
376-
message: jasmine.stringMatching(
377-
`Server at ${sharedNeo4j.hostname}:7687 can't perform routing. Make sure you are connecting to a causal cluster.`
378-
)
379-
})
380-
)
373+
let completed = false
374+
try {
375+
await session.run('RETURN 1')
376+
completed = true
377+
} catch (error) {
378+
expect(error.code).toEqual(neo4j.error.SERVICE_UNAVAILABLE)
379+
expect(error.message).toEqual(
380+
`Server at ${sharedNeo4j.hostname}:7687 can't perform routing. ` +
381+
'Make sure you are connecting to a causal cluster.'
382+
)
383+
} finally {
384+
await session.close()
385+
}
381386

382-
await session.close()
387+
expect(completed).toBe(false)
383388
})
384389

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

0 commit comments

Comments
 (0)