Skip to content

Commit 3e30b3e

Browse files
bigmontzrobsdedude
andcommitted
Apply suggestions from code review
Co-authored-by: Robsdedude <dev@rouvenbauer.de>
1 parent caa1810 commit 3e30b3e

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

packages/core/src/result.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ class Result implements Promise<QueryResult> {
374374
}
375375

376376
/**
377-
* Check if this result is active, which means summary or error are not received by the result.
378-
* @return {boolean} `true` when summary or error are not received by the result.
377+
* Check if this result is active, i.e., neither a summary nor an error has been received by the result.
378+
* @return {boolean} `true` when neither a summary or nor an error has been received by the result.
379379
*/
380380
isOpen (): boolean {
381381
return this._summary === null && this._error === null

packages/core/test/result.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,14 @@ describe('Result', () => {
454454
it.each([
455455
['success', async (stream: any) => stream.onCompleted({})],
456456
//['error', async (stream: any) => stream.onError(new Error('error'))],
457-
])('should thrown over an consumed result [%s]', async(_, completeStream) => {
457+
])('should throw when iterating over consumed result [%s]', async(_, completeStream) => {
458458
completeStream(streamObserverMock)
459459

460460
await result.summary().catch(() => {})
461461

462462
try {
463463
await result
464-
expect('not finish iteration over consumed result').toBe(true)
464+
expect('not to finish iteration over consumed result').toBe(true)
465465
} catch (e) {
466466
expect(e).toEqual(newError('Result is already consumed'))
467467
}
@@ -879,21 +879,21 @@ describe('Result', () => {
879879
it.each([
880880
['success', async (stream: any) => stream.onCompleted({})],
881881
['error', async (stream: any) => stream.onError(new Error('error'))],
882-
])('should thrown on iterate over an consumed result [%s]', async(_, completeStream) => {
882+
])('should thrown on iterating over an consumed result [%s]', async(_, completeStream) => {
883883
completeStream(streamObserverMock)
884884

885885
await result.summary().catch(() => {})
886886

887887
try {
888888
for await (const _ of result) {
889-
expect('not iterate over consumed result').toBe(true)
889+
expect('not to iterate over consumed result').toBe(true)
890890
}
891-
expect('not finish iteration over consumed result').toBe(true)
891+
expect('not to finish iteration over consumed result').toBe(true)
892892
} catch (e) {
893893
expect(e).toEqual(newError('Result is already consumed'))
894894
}
895895

896-
expect('not finish iteration over consumed result')
896+
expect('not to finish iteration over consumed result')
897897
})
898898

899899
describe('.return()', () => {
@@ -1257,7 +1257,7 @@ describe('Result', () => {
12571257
expect(result.isOpen()).toBe(false)
12581258
})
12591259

1260-
it('should return false when the stream is failed', async () => {
1260+
it('should return false when the stream failed', async () => {
12611261
streamObserverMock.onError(new Error('test'))
12621262

12631263
await result._subscribe({}).catch(() => {})
@@ -1385,7 +1385,7 @@ describe('Result', () => {
13851385
expect(result.isOpen()).toBe(true)
13861386
})
13871387

1388-
it('should be false after any interactio with the stream', async () => {
1388+
it('should be false after any interaction with the stream', async () => {
13891389
const it = result[Symbol.asyncIterator]()
13901390
await it.next()
13911391

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ const skippedTests = [
138138
'stub.iteration.test_result_list.TestResultList.test_session_run_result_list_pulls_all_records_at_once_next_before_list'
139139
)
140140
),
141-
// skip(
142-
// 'Results are always valid but don\'t return records when out of scope',
143-
// ifStartsWith('stub.iteration.test_result_scope.TestResultScope.')
144-
// ),
145141
skip(
146142
'Driver (still) allows explicit managing of managed transaction',
147143
ifEquals('stub.tx_lifetime.test_tx_lifetime.TestTxLifetime.test_managed_tx_raises_tx_managed_exec')

0 commit comments

Comments
 (0)