Skip to content

Commit af970ef

Browse files
committed
Fix test failures regarding bookmark passing to beginTransaction
1 parent 1b3c6e3 commit af970ef

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/transaction.test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,12 @@ describe('transaction', () => {
355355
})
356356
})
357357

358-
it('should fail for invalid bookmark', done => {
359-
const invalidBookmark = 'hi, this is an invalid bookmark'
360-
const tx = session.beginTransaction(invalidBookmark)
361-
tx.run('RETURN 1').catch(error => {
362-
expect(error.code).toBe('Neo.ClientError.Transaction.InvalidBookmark')
363-
done()
364-
})
358+
it('should throw when provided string (bookmark) parameter', () => {
359+
expect(() => session.beginTransaction('bookmark')).toThrowError(TypeError)
360+
})
361+
362+
it('should throw when provided string[] (bookmark) parameter', () => {
363+
expect(() => session.beginTransaction(['bookmark'])).toThrowError(TypeError)
365364
})
366365

367366
it('should fail to run query for unreachable bookmark', done => {
@@ -377,7 +376,10 @@ describe('transaction', () => {
377376
expectValidLastBookmark(session)
378377

379378
const unreachableBookmark = session.lastBookmark() + '0'
380-
const tx2 = session.beginTransaction(unreachableBookmark)
379+
const session2 = driver.session({
380+
bookmarks: [unreachableBookmark]
381+
})
382+
const tx2 = session2.beginTransaction()
381383
tx2.run('CREATE ()').catch(error => {
382384
const message = error.message
383385
const expectedPrefix =

0 commit comments

Comments
 (0)