diff --git a/test/tsc-build/strict-checks/enableKeepAlive-and-keepAliveInitialDelay.ts b/test/tsc-build/strict-checks/enableKeepAlive-and-keepAliveInitialDelay.ts new file mode 100644 index 0000000000..00dfe8840d --- /dev/null +++ b/test/tsc-build/strict-checks/enableKeepAlive-and-keepAliveInitialDelay.ts @@ -0,0 +1,35 @@ +import { mysql, mysqlp } from '../index.js'; + +// Callback +(() => { + const poolOptions: mysql.PoolOptions = { + enableKeepAlive: true, + keepAliveInitialDelay: 0, + } + + const connectionOptions: mysql.ConnectionOptions = { + enableKeepAlive: true, + keepAliveInitialDelay: 0, + } + + mysql.createConnection(connectionOptions); + mysql.createPool(poolOptions); + mysql.createPoolCluster().add(poolOptions); +})(); + +// Promise +(() => { + const poolOptions: mysqlp.PoolOptions = { + enableKeepAlive: true, + keepAliveInitialDelay: 0, + } + + const connectionOptions: mysqlp.ConnectionOptions = { + enableKeepAlive: true, + keepAliveInitialDelay: 0, + } + + mysqlp.createConnection(connectionOptions); + mysqlp.createPool(poolOptions); + mysqlp.createPoolCluster().add(poolOptions); +})();