Skip to content

Commit 737be62

Browse files
committed
ci: add createPool release tsc build test
1 parent 67a5b81 commit 737be62

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { mysql } from '../../../index';
2+
import { access } from '../../baseConnection';
3+
4+
const pool = mysql.createPool(access);
5+
6+
pool.getConnection((err, conn) => {
7+
conn.release();
8+
9+
try {
10+
// @ts-expect-error: The pool isn't a connection itself, so it doesn't have the connection methods
11+
pool.release();
12+
} catch (err) {
13+
console.log('This error is expected', err);
14+
}
15+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { mysql } from '../../../index';
2+
import { access } from '../../baseConnection';
3+
4+
(async () => {
5+
const pool = mysql.createPool(access);
6+
const conn = await pool.promise().getConnection();
7+
8+
conn.release();
9+
10+
try {
11+
// @ts-expect-error: The pool isn't a connection itself, so it doesn't have the connection methods
12+
pool.release();
13+
} catch (err) {
14+
console.log('This error is expected', err);
15+
}
16+
})();
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { mysqlp as mysql } from '../../index';
2+
import { access } from '../baseConnection';
3+
4+
(async () => {
5+
const pool = mysql.createPool(access);
6+
const conn = await pool.getConnection();
7+
8+
conn.release();
9+
10+
try {
11+
// @ts-expect-error: The pool isn't a connection itself, so it doesn't have the connection methods
12+
pool.release();
13+
} catch (err) {
14+
console.log('This error is expected', err);
15+
}
16+
})();

0 commit comments

Comments
 (0)