mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Update packages/pg-transaction/src/index.test.ts
Co-authored-by: Charmander <~@charmander.me>
This commit is contained in:
parent
0328cb30ae
commit
1d9c68ecbc
@ -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')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user