Skip to content

Commit

Permalink
fix: PromisePoolCluster.of returns PromisePoolCluster instead of Pool…
Browse files Browse the repository at this point in the history
…Namespace (#3091)
  • Loading branch information
jcmartineztiempo committed Dec 10, 2024
1 parent 9c0c292 commit 6a00b0f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/esm/integration/pool-cluster/test-promise-wrapper.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,24 @@ const { createPoolCluster } = require('../../../../promise.js');

const poolNamespace = poolCluster.of('MASTER');

assert.equal(poolNamespace.poolNamespace, poolCluster.poolCluster.of('MASTER'));
assert.equal(
poolNamespace.poolNamespace,
poolCluster.poolCluster.of('MASTER'),
);

const connection = await poolNamespace.getConnection();

assert.ok(connection, 'should get connection');
connection.release();

const [result] = await poolNamespace.query(
'SELECT 1 as a where 1 = ?',
[1],
);
const [result] = await poolNamespace.query('SELECT 1 as a where 1 = ?', [
1,
]);
assert.equal(result[0]['a'], 1, 'should query successfully');

const [result2] = await poolNamespace.execute(
'SELECT 1 as a where 1 = ?',
[1],
);
const [result2] = await poolNamespace.execute('SELECT 1 as a where 1 = ?', [
1,
]);
assert.equal(result2[0]['a'], 1, 'should execute successfully');

poolCluster.end();
Expand Down

0 comments on commit 6a00b0f

Please sign in to comment.