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

Co-authored-by: Charmander <~@charmander.me>
This commit is contained in:
Brian C 2025-07-19 06:37:58 -05:00 committed by GitHub
parent 0328cb30ae
commit 1d9c68ecbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,6 +54,12 @@ describe('Transaction', () => {
const { rowCount } = await innerClient.query('SELECT * FROM test_table')
assert.equal(rowCount, 0, 'Temp table should still be empty inside transaction')
})
// now that the transaction is committed, the changes are visible outside
await withClient(async (innerClient) => {
const { rowCount } = await innerClient.query('SELECT * FROM test_table')
assert.equal(rowCount, 1, 'Row should be inserted after transaction commits')
})
})
})
})