Skip to content

Commit b2e9cb1

Browse files
authored
Remove testAsync - its redundant (#3588)
1 parent 46cdf9e commit b2e9cb1

20 files changed

Lines changed: 45 additions & 50 deletions

packages/pg/test/integration/client/async-stack-trace-tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const suite = new helper.Suite()
1212
// these tests will only work for if --async-stack-traces is on, which is the default starting in node 16.
1313
const NODE_MAJOR_VERSION = +process.versions.node.split('.')[0]
1414
if (NODE_MAJOR_VERSION >= 16) {
15-
suite.testAsync('promise API async stack trace in pool', async function outerFunction() {
15+
suite.test('promise API async stack trace in pool', async function outerFunction() {
1616
async function innerFunction() {
1717
const pool = new pg.Pool()
1818
await pool.query('SELECT test from nonexistent')
@@ -28,7 +28,7 @@ if (NODE_MAJOR_VERSION >= 16) {
2828
}
2929
})
3030

31-
suite.testAsync('promise API async stack trace in client', async function outerFunction() {
31+
suite.test('promise API async stack trace in client', async function outerFunction() {
3232
async function innerFunction() {
3333
const client = new pg.Client()
3434
await client.connect()

packages/pg/test/integration/client/error-handling-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ suite.test('re-using connections results in error callback', (done) => {
4747
})
4848
})
4949

50-
suite.testAsync('re-using connections results in promise rejection', () => {
50+
suite.test('re-using connections results in promise rejection', () => {
5151
const client = new Client()
5252
return client.connect().then(() => {
5353
return helper.rejection(client.connect()).then((err) => {

packages/pg/test/integration/client/prepared-statement-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const suite = new helper.Suite()
174174
checkForResults(query)
175175
})
176176

177-
suite.testAsync('with no data response and rows', async function () {
177+
suite.test('with no data response and rows', async function () {
178178
const result = await client.query({
179179
name: 'some insert',
180180
text: '',

packages/pg/test/integration/client/sasl-scram-tests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ const config = {
3737
}
3838

3939
if (native) {
40-
suite.testAsync('skipping SCRAM tests (on native)', () => {})
40+
suite.test('skipping SCRAM tests (on native)', () => {})
4141
return
4242
}
4343
if (!config.user || !config.password) {
44-
suite.testAsync('skipping SCRAM tests (missing env)', () => {})
44+
suite.test('skipping SCRAM tests (missing env)', () => {})
4545
return
4646
}
4747

48-
suite.testAsync('can connect using sasl/scram with channel binding enabled (if using SSL)', async () => {
48+
suite.test('can connect using sasl/scram with channel binding enabled (if using SSL)', async () => {
4949
const client = new pg.Client({ ...config, enableChannelBinding: true })
5050
let usingChannelBinding = false
5151
let hasPeerCert = false
@@ -58,7 +58,7 @@ suite.testAsync('can connect using sasl/scram with channel binding enabled (if u
5858
await client.end()
5959
})
6060

61-
suite.testAsync('can connect using sasl/scram with channel binding disabled', async () => {
61+
suite.test('can connect using sasl/scram with channel binding disabled', async () => {
6262
const client = new pg.Client({ ...config, enableChannelBinding: false })
6363
let usingSASLWithoutChannelBinding = false
6464
client.connection.once('authenticationSASLContinue', () => {
@@ -69,7 +69,7 @@ suite.testAsync('can connect using sasl/scram with channel binding disabled', as
6969
await client.end()
7070
})
7171

72-
suite.testAsync('sasl/scram fails when password is wrong', async () => {
72+
suite.test('sasl/scram fails when password is wrong', async () => {
7373
const client = new pg.Client({
7474
...config,
7575
password: config.password + 'append-something-to-make-it-bad',
@@ -88,7 +88,7 @@ suite.testAsync('sasl/scram fails when password is wrong', async () => {
8888
assert.ok(usingSasl, 'Should be using SASL for authentication')
8989
})
9090

91-
suite.testAsync('sasl/scram fails when password is empty', async () => {
91+
suite.test('sasl/scram fails when password is empty', async () => {
9292
const client = new pg.Client({
9393
...config,
9494
// We use a password function here so the connection defaults do not

packages/pg/test/integration/client/timezone-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pool.connect(function (err, client, done) {
2121
})
2222
})
2323

24-
suite.testAsync('date comes out as a date', async function () {
24+
suite.test('date comes out as a date', async function () {
2525
const { rows } = await client.query('SELECT NOW()::DATE AS date')
2626
assert(rows[0].date instanceof Date)
2727
})

packages/pg/test/integration/connection-pool/connection-pool-size-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const assert = require('assert')
55
const suite = new helper.Suite()
66

77
const testPoolSize = function (max) {
8-
suite.testAsync(`test ${max} queries executed on a pool rapidly`, async () => {
8+
suite.test(`test ${max} queries executed on a pool rapidly`, async () => {
99
const pool = new helper.pg.Pool({ max: 10 })
1010

1111
let count = 0

packages/pg/test/integration/connection-pool/tls-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const pg = helper.pg
88
const suite = new helper.Suite()
99

1010
if (process.env.PG_CLIENT_CERT_TEST) {
11-
suite.testAsync('client certificate', async () => {
11+
suite.test('client certificate', async () => {
1212
const pool = new pg.Pool({
1313
ssl: {
1414
ca: fs.readFileSync(process.env.PGSSLROOTCERT),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const helper = require('../test-helper')
22
const suite = new helper.Suite()
33

4-
suite.testAsync('timeout causing query crashes', async () => {
4+
suite.test('timeout causing query crashes', async () => {
55
const client = new helper.Client()
66
await client.connect()
77
await client.query('CREATE TEMP TABLE foobar( name TEXT NOT NULL, id SERIAL)')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const assert = require('assert')
44

55
const suite = new helper.Suite()
66

7-
suite.testAsync('BoundPool can be subclassed', async () => {
7+
suite.test('BoundPool can be subclassed', async () => {
88
const Pool = helper.pg.Pool
99
class SubPool extends Pool {}
1010
const subPool = new SubPool()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (process.env.PGTESTNOSSL) {
1010
return
1111
}
1212

13-
suite.testAsync('it should connect over ssl', async () => {
13+
suite.test('it should connect over ssl', async () => {
1414
const ssl = helper.args.native
1515
? 'require'
1616
: {
@@ -23,7 +23,7 @@ suite.testAsync('it should connect over ssl', async () => {
2323
await client.end()
2424
})
2525

26-
suite.testAsync('it should fail with self-signed cert error w/o rejectUnauthorized being passed', async () => {
26+
suite.test('it should fail with self-signed cert error w/o rejectUnauthorized being passed', async () => {
2727
const ssl = helper.args.native ? 'verify-ca' : {}
2828
const client = new helper.pg.Client({ ssl })
2929
try {

0 commit comments

Comments
 (0)