diff --git a/package-lock.json b/package-lock.json index 311dc1a0e..0e41d5d9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "prettier": "^3.1.1", "sinon": "^17.0.1", "tarn": "^3.0.2", - "tedious": "^16.4.0", + "tedious": "^17.0.0", "tsd": "^0.30.3", "typescript": "^5.4.2" }, @@ -4831,9 +4831,9 @@ } }, "node_modules/tedious": { - "version": "16.7.1", - "resolved": "https://registry.npmjs.org/tedious/-/tedious-16.7.1.tgz", - "integrity": "sha512-NmedZS0NJiTv3CoYnf1FtjxIDUgVYzEmavrc8q2WHRb+lP4deI9BpQfmNnBZZaWusDbP5FVFZCcvzb3xOlNVlQ==", + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/tedious/-/tedious-17.0.0.tgz", + "integrity": "sha512-tXsl/kvDAFpnXU+ooEOQyrXdJFD0/OWvPq9i1bDhbOvoFGcrZURiXyUxbI8gJPsG6o2K5fs3HX6zRTSxuCUC5g==", "dev": true, "dependencies": { "@azure/identity": "^3.4.1", @@ -4849,7 +4849,7 @@ "sprintf-js": "^1.1.2" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/tedious/node_modules/bl": { diff --git a/package.json b/package.json index a6ae37c86..a854a1977 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:node:run": "mocha --timeout 15000 test/node/dist/**/*.test.js", "test:browser:build": "rm -rf test/browser/bundle.js && esbuild test/browser/main.ts --bundle --outfile=test/browser/bundle.js", "test:browser": "npm run build && npm run test:browser:build && node test/browser/test.js", - "test:bun": "npm run build && cd test/bun && bun install && bun run test", + "test:bun": "npm run build && bun link && cd test/bun && bun install && bun run test", "test:cloudflare-workers": "npm run build && cd test/cloudflare-workers && npm ci && npm test", "test:deno": "npm run build && deno run --allow-env --allow-read --allow-net test/deno/local.test.ts && deno run --allow-env --allow-read --allow-net test/deno/cdn.test.ts", "test:typings": "tsd test/typings", @@ -94,7 +94,7 @@ "prettier": "^3.1.1", "sinon": "^17.0.1", "tarn": "^3.0.2", - "tedious": "^16.4.0", + "tedious": "^17.0.0", "tsd": "^0.30.3", "typescript": "^5.4.2" } diff --git a/test/bun/bun.lockb b/test/bun/bun.lockb old mode 100644 new mode 100755 index e716655b7..19a9da9e2 Binary files a/test/bun/bun.lockb and b/test/bun/bun.lockb differ diff --git a/test/bun/bun.test.ts b/test/bun/bun.test.ts index 9becba23d..fc671a688 100644 --- a/test/bun/bun.test.ts +++ b/test/bun/bun.test.ts @@ -1,11 +1,14 @@ import { createPool } from 'mysql2' import { Pool } from 'pg' +import * as Tarn from 'tarn' +import * as Tedious from 'tedious' import { Generated, Kysely, PostgresDialect, MysqlDialect, sql, + MssqlDialect, } from '../../dist/esm/index.js' interface Person { @@ -40,6 +43,38 @@ const dbs = [ }), }), }), + new Kysely({ + dialect: new MssqlDialect({ + tarn: { + ...Tarn, + options: { + min: 0, + max: 10, + }, + }, + tedious: { + ...Tedious, + connectionFactory: () => + new Tedious.Connection({ + authentication: { + options: { + password: 'KyselyTest0', + userName: 'sa', + }, + type: 'default', + }, + options: { + connectTimeout: 3000, + database: 'kysely_test', + encrypt: false, + port: 21433, + trustServerCertificate: true, + }, + server: 'localhost', + }), + }, + }), + }), ] if ( @@ -60,3 +95,5 @@ await Promise.all(dbs.map((db) => query.execute(db))) console.log('bun test passed') await Promise.all(dbs.map((db) => db.destroy())) + +process.exit(0) // hangs otherwise... diff --git a/test/bun/package.json b/test/bun/package.json index 08285b44f..05823019f 100644 --- a/test/bun/package.json +++ b/test/bun/package.json @@ -5,8 +5,14 @@ "test": "bun bun.test.ts" }, "dependencies": { - "kysely": "^0.25.0", + "kysely": "link:kysely", "mysql2": "^3.3.3", - "pg": "^8.11.0" + "pg": "^8.11.0", + "tarn": "^3.0.2", + "tedious": "^17.0.0" + }, + "devDependencies": { + "@types/bun": "^1.1.3", + "typescript": "^5.4.5" } }