Skip to content

Commit 976e404

Browse files
authored
Handle getting summary in Testkit Backend when a Record Iterator exists (#1258)
1 parent 279d140 commit 976e404

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/testkit-backend/src/request-handlers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ export function ResultConsume (_, context, data, wire) {
241241
const { resultId } = data
242242
const result = context.getResult(resultId)
243243

244-
return result.summary().then(summary => {
244+
let summaryPromise = 'recordIt' in result
245+
? (async () => {return (await result.recordIt.return()).value})()
246+
: result.summary()
247+
return summaryPromise.then(summary => {
245248
wire.writeResponse(responses.Summary({ summary }, { binder: context.binder }))
246249
}).catch(e => wire.writeError(e))
247250
}

packages/testkit-backend/src/skipped-tests/common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const skippedTests = [
5656
skip(
5757
'ResultSummary.notifications defaults to empty array instead of return null/undefined',
5858
ifEquals('stub.summary.test_summary.TestSummaryNotifications4x4.test_no_notifications'),
59+
ifEquals('stub.summary.test_summary.TestSummaryNotifications4x4Discard.test_no_notifications'),
5960
ifEquals('neo4j.test_summary.TestSummary.test_no_notification_info')
6061
),
6162
skip(

0 commit comments

Comments
 (0)