Skip to content

Commit 767eaef

Browse files
author
diego Dupin
committed
Updating documentation and README examples using mostly async/await
1 parent 9f9b2f6 commit 767eaef

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

lib/pool-base.js

Whitespace-only changes.

test/integration/test-pool.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('Pool', () => {
148148
assert(err.message.includes('sql parameter is mandatory'));
149149
assert.equal(err.sqlState, 'HY000');
150150
assert.equal(err.errno, 45049);
151-
assert.equal(err.code, 'ER_POOL_UNDEFINED_SQL');
151+
assert.equal(err.code, 'ER_UNDEFINED_SQL');
152152
} finally {
153153
await pool.end();
154154
}
@@ -163,7 +163,7 @@ describe('Pool', () => {
163163
assert(err.message.includes('sql parameter is mandatory'));
164164
assert.equal(err.sqlState, 'HY000');
165165
assert.equal(err.errno, 45049);
166-
assert.equal(err.code, 'ER_POOL_UNDEFINED_SQL');
166+
assert.equal(err.code, 'ER_UNDEFINED_SQL');
167167
} finally {
168168
await pool.end();
169169
}
@@ -242,12 +242,7 @@ describe('Pool', () => {
242242
});
243243

244244
it('pool with wrong authentication connection', async function () {
245-
if (
246-
process.env.srv === 'maxscale' ||
247-
process.env.srv === 'skysql' ||
248-
process.env.srv === 'skysql-ha'
249-
)
250-
this.skip();
245+
if (process.env.srv === 'maxscale' || process.env.srv === 'skysql' || process.env.srv === 'skysql-ha') this.skip();
251246
this.timeout(10000);
252247
let err;
253248
let pool;
@@ -289,12 +284,7 @@ describe('Pool', () => {
289284
});
290285

291286
it('create pool', async function () {
292-
if (
293-
process.env.srv === 'maxscale' ||
294-
process.env.srv === 'skysql' ||
295-
process.env.srv === 'skysql-ha'
296-
)
297-
this.skip();
287+
if (process.env.srv === 'maxscale' || process.env.srv === 'skysql' || process.env.srv === 'skysql-ha') this.skip();
298288
this.timeout(5000);
299289
const pool = base.createPool({ connectionLimit: 1 });
300290
const initTime = Date.now();

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ export interface PoolCluster {
744744
remove(pattern: string): void;
745745
getConnection(pattern?: string, selector?: string): Promise<PoolConnection>;
746746

747-
on(ev: 'remove', callback: (nodekey: string) => void): PoolCluster
747+
on(ev: 'remove', callback: (nodekey: string) => void): PoolCluster;
748748
}
749749

750750
export interface UpsertResult {

0 commit comments

Comments
 (0)