Skip to content

Commit 1d9c68e

Browse files
brianccharmander
andauthored
Update packages/pg-transaction/src/index.test.ts
Co-authored-by: Charmander <[email protected]>
1 parent 0328cb3 commit 1d9c68e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/pg-transaction/src/index.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ describe('Transaction', () => {
5454
const { rowCount } = await innerClient.query('SELECT * FROM test_table')
5555
assert.equal(rowCount, 0, 'Temp table should still be empty inside transaction')
5656
})
57+
58+
// now that the transaction is committed, the changes are visible outside
59+
await withClient(async (innerClient) => {
60+
const { rowCount } = await innerClient.query('SELECT * FROM test_table')
61+
assert.equal(rowCount, 1, 'Row should be inserted after transaction commits')
62+
})
5763
})
5864
})
5965
})

0 commit comments

Comments
 (0)