Skip to content

Commit 6b802d5

Browse files
committed
chore: fix lints
1 parent 65d85d5 commit 6b802d5

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

packages/pg/test/integration/client/max-result-size-tests.js

+22-17
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var assert = require('assert')
55
const pool = new helper.pg.Pool({
66
maxResultSize: 100, // Very small size limit (100 bytes)
77
// Keep other connection parameters from helper
8-
...helper.args
8+
...helper.args,
99
})
1010

1111
// Flag to track if we've seen the first type of error message
@@ -14,24 +14,27 @@ let sizeExceededErrorSeen = false
1414
pool.connect(
1515
assert.success(function (client) {
1616
// First create a temp table
17-
client.query('CREATE TEMP TABLE large_result_test(id SERIAL, data TEXT)', assert.success(function () {
18-
// Insert data that will exceed the size limit when selected
19-
const insertPromises = []
20-
for (let i = 0; i < 20; i++) {
21-
// Each row will have 50 bytes of data
22-
const data = 'x'.repeat(50)
23-
insertPromises.push(
24-
client.query('INSERT INTO large_result_test(data) VALUES($1)', [data])
25-
)
26-
}
17+
client.query(
18+
'CREATE TEMP TABLE large_result_test(id SERIAL, data TEXT)',
19+
assert.success(function () {
20+
// Insert data that will exceed the size limit when selected
21+
const insertPromises = []
22+
for (let i = 0; i < 20; i++) {
23+
// Each row will have 50 bytes of data
24+
const data = 'x'.repeat(50)
25+
insertPromises.push(client.query('INSERT INTO large_result_test(data) VALUES($1)', [data]))
26+
}
2727

28-
// After inserting all rows, attempt to select them all
29-
Promise.all(insertPromises)
30-
.then(function () {
28+
// After inserting all rows, attempt to select them all
29+
Promise.all(insertPromises).then(function () {
3130
client.on('error', (err) => {
3231
// If we see the first error type, mark it
3332
if (err.message === 'Query result size exceeded the configured limit') {
34-
assert.equal(err.code, 'RESULT_SIZE_EXCEEDED', 'Size exceeded error should have RESULT_SIZE_EXCEEDED code')
33+
assert.equal(
34+
err.code,
35+
'RESULT_SIZE_EXCEEDED',
36+
'Size exceeded error should have RESULT_SIZE_EXCEEDED code'
37+
)
3538
sizeExceededErrorSeen = true
3639
}
3740

@@ -42,14 +45,16 @@ pool.connect(
4245
})
4346

4447
// This query should fail due to exceeding size limit
45-
client.query('SELECT * FROM large_result_test')
48+
client
49+
.query('SELECT * FROM large_result_test')
4650
.then(function (_result) {
4751
throw new Error('Query should have failed due to size limit')
4852
})
4953
.catch(function (err) {
5054
assert.equal(err.code, 'RESULT_SIZE_EXCEEDED', 'Query error should have RESULT_SIZE_EXCEEDED code')
5155
})
5256
})
53-
}))
57+
})
58+
)
5459
})
5560
)

0 commit comments

Comments
 (0)