Skip to content

Commit 635f425

Browse files
committed
test: Fix and tighten assertion that would always pass
because of the `SELECTR` typo.
1 parent 3740f9e commit 635f425

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/pg/test/integration/gh-issues/3174-tests.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ const testErrorBuffer = (bufferName, errorBuffer) => {
104104
if (!cli.native) {
105105
assert(errorHit)
106106
// further queries on the client should fail since its in an invalid state
107-
await assert.rejects(() => client.query('SELECTR NOW()'), 'Further queries on the client should reject')
107+
await assert.rejects(client.query('SELECT NOW()'), {
108+
message: 'Client has encountered a connection error and is not queryable',
109+
})
108110
}
109111

110112
await closeServer()
@@ -129,7 +131,9 @@ const testErrorBuffer = (bufferName, errorBuffer) => {
129131
if (!cli.native) {
130132
assert(errorHit)
131133
// further queries on the client should fail since its in an invalid state
132-
await assert.rejects(() => client.query('SELECTR NOW()'), 'Further queries on the client should reject')
134+
await assert.rejects(client.query('SELECT NOW()'), {
135+
message: 'Client has encountered a connection error and is not queryable',
136+
})
133137
}
134138

135139
await client.end()

0 commit comments

Comments
 (0)