Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ export default [
'@typescript-eslint/no-unsafe-function-type': 'off',
},
},
{
files: ['test/tsc-build/**/*.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['**/*.mjs', '**/*.mts'],
languageOptions: {
Expand Down
19 changes: 0 additions & 19 deletions test/tsc-build/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,3 @@ export const isResultSetHeader = (

return keys.every((key) => key in data);
};

export const isOkPacket = (
data: unknown
): data is mysql.OkPacket | mysqlp.OkPacket => {
if (!data || typeof data !== 'object') return false;

const keys = [
'fieldCount',
'affectedRows',
'changedRows',
'insertId',
'serverStatus',
'warningCount',
'message',
'protocol41',
];

return keys.every((key) => key in data);
};
2 changes: 0 additions & 2 deletions test/tsc-build/mysql/constants/CharsetToEncoding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ import { mysql } from '../../index.test.js';

const charsetToEncoding: string[] = mysql.CharsetToEncoding;
const utf8: string = charsetToEncoding[0];

console.log(utf8, charsetToEncoding);
2 changes: 0 additions & 2 deletions test/tsc-build/mysql/constants/Charsets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ import { mysql } from '../../index.test.js';

const BIG5_CHINESE_CI: number = mysql.Charsets.BIG5_CHINESE_CI;
const BIG5: number = mysql.Charsets.BIG5;

console.log(BIG5_CHINESE_CI, BIG5);
2 changes: 0 additions & 2 deletions test/tsc-build/mysql/constants/Types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ import { mysql } from '../../index.test.js';
const BLOB: number = mysql.Types.BLOB;
const DECIMAL: string = mysql.Types[0x00];
const DOUBLE: string = mysql.Types[5];

console.log(BLOB, DECIMAL, DOUBLE);
31 changes: 0 additions & 31 deletions test/tsc-build/mysql/createConnection/callbacks/execute.test.ts

This file was deleted.

31 changes: 0 additions & 31 deletions test/tsc-build/mysql/createConnection/callbacks/query.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions test/tsc-build/mysql/createConnection/promise/execute.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions test/tsc-build/mysql/createConnection/promise/query.test.ts

This file was deleted.

10 changes: 3 additions & 7 deletions test/tsc-build/mysql/createPool/callbacks/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ import { access } from '../../baseConnection.test.js';

const pool = mysql.createPool(access);

pool.getConnection((_err, conn) => {
pool.getConnection((_, conn) => {
conn.connection;

try {
// @ts-expect-error: The pool can't be a connection itself
pool.connection;
} catch (err) {
console.log('This error is expected', err);
}
// @ts-expect-error: The pool can't be a connection itself
pool.connection;
});
13 changes: 3 additions & 10 deletions test/tsc-build/mysql/createPool/callbacks/createPool.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { mysql } from '../../../index.test.js';
import { uriAccess, access } from '../../baseConnection.test.js';
import { uriAccess } from '../../baseConnection.test.js';

(() => {
let uriPool: mysql.Pool | null = null;
let pool: mysql.Pool | null = null;

if (uriPool === null || pool === null) return;

uriPool = mysql.createPool(uriAccess);
pool = mysql.createPool(access);
})();
// createPool(uri) overload is not covered by .mts tests
const pool: mysql.Pool = mysql.createPool(uriAccess);
61 changes: 0 additions & 61 deletions test/tsc-build/mysql/createPool/callbacks/execute.test.ts

This file was deleted.

10 changes: 3 additions & 7 deletions test/tsc-build/mysql/createPool/callbacks/getConnection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { access } from '../../baseConnection.test.js';

const pool = mysql.createPool(access);

pool.getConnection((_err, conn) => {
try {
// @ts-expect-error: The connection can't get another connection
conn.getConnection();
} catch (err) {
console.log('This error is expected', err);
}
pool.getConnection((_) => {
// @ts-expect-error: The connection can't get another connection
conn.getConnection();
});
61 changes: 0 additions & 61 deletions test/tsc-build/mysql/createPool/callbacks/query.test.ts

This file was deleted.

12 changes: 2 additions & 10 deletions test/tsc-build/mysql/createPool/callbacks/release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,5 @@ import { access } from '../../baseConnection.test.js';

const pool = mysql.createPool(access);

pool.getConnection((_err, conn) => {
conn.release();

try {
// @ts-expect-error: The pool isn't a connection itself, so it doesn't have the connection methods
pool.release();
} catch (err) {
console.log('This error is expected', err);
}
});
// @ts-expect-error: The pool isn't a connection itself, so it doesn't have the connection methods
pool.release();

This file was deleted.

Loading
Loading