Skip to content

Commit 8f27b41

Browse files
Fix: PromisePoolCluster.of returns PromisePoolCluster instead of PoolNamespace (#3091)
1 parent d39eb82 commit 8f27b41

1 file changed

Lines changed: 8 additions & 38 deletions

File tree

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

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -80,42 +80,6 @@ const { createPoolCluster } = require('../../../../promise.js');
8080
poolCluster.poolCluster.emit('online');
8181
});
8282

83-
await test(async () => {
84-
const poolCluster = createPoolCluster();
85-
86-
poolCluster.once('offline', async function () {
87-
await new Promise((resolve) => {
88-
assert.equal(
89-
// eslint-disable-next-line no-invalid-this
90-
this,
91-
poolCluster,
92-
'should propagate offline event to promise wrapper',
93-
);
94-
resolve(true);
95-
});
96-
});
97-
98-
poolCluster.poolCluster.emit('offline');
99-
});
100-
101-
await test(async () => {
102-
const poolCluster = createPoolCluster();
103-
104-
poolCluster.once('online', async function () {
105-
await new Promise((resolve) => {
106-
assert.equal(
107-
// eslint-disable-next-line no-invalid-this
108-
this,
109-
poolCluster,
110-
'should propagate online event to promise wrapper',
111-
);
112-
resolve(true);
113-
});
114-
});
115-
116-
poolCluster.poolCluster.emit('online');
117-
});
118-
11983
await test(async () => {
12084
const poolCluster = createPoolCluster();
12185
poolCluster.add('MASTER', common.config);
@@ -127,10 +91,16 @@ const { createPoolCluster } = require('../../../../promise.js');
12791
assert.ok(connection, 'should get connection');
12892
connection.release();
12993

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

133-
const result2 = await poolNamespace.execute('SELECT 1 as a from dual where 1 = ?', [1]);
100+
const result2 = await poolNamespace.execute(
101+
'SELECT 1 as a from dual where 1 = ?',
102+
[1],
103+
);
134104
assert.equal(result2[0]['a'], 1, 'should execute successfully');
135105
});
136106
})();

0 commit comments

Comments
 (0)