Skip to content

Commit 9c0c292

Browse files
fix: PromisePoolCluster.of returns PromisePoolCluster instead of PoolNamespace (#3091)
1 parent 2d1a3be commit 9c0c292

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/esm/integration/pool-cluster/test-promise-wrapper.test.mjs

+8-4
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,25 @@ const { createPoolCluster } = require('../../../../promise.js');
8686

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

89+
assert.equal(poolNamespace.poolNamespace, poolCluster.poolCluster.of('MASTER'));
90+
8991
const connection = await poolNamespace.getConnection();
9092

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

94-
const result = await poolNamespace.query(
95-
'SELECT 1 as a from dual where 1 = ?',
96+
const [result] = await poolNamespace.query(
97+
'SELECT 1 as a where 1 = ?',
9698
[1],
9799
);
98100
assert.equal(result[0]['a'], 1, 'should query successfully');
99101

100-
const result2 = await poolNamespace.execute(
101-
'SELECT 1 as a from dual where 1 = ?',
102+
const [result2] = await poolNamespace.execute(
103+
'SELECT 1 as a where 1 = ?',
102104
[1],
103105
);
104106
assert.equal(result2[0]['a'], 1, 'should execute successfully');
107+
108+
poolCluster.end();
105109
});
106110
})();

0 commit comments

Comments
 (0)