diff --git a/packages/pg/Makefile b/packages/pg/Makefile index 7f4aebfa..5575acfd 100644 --- a/packages/pg/Makefile +++ b/packages/pg/Makefile @@ -54,5 +54,11 @@ test-pool: @find test/integration/connection-pool -name "*.js" | $(node-command) binary test-worker: - @echo "***Testing Cloudflare Worker support***" - yarn vitest run -c test/vitest.config.mts test/cloudflare/ --no-watch -- $(params) + # this command only runs in node 18.x and above since there are + # worker specific items missing from the node environment in lower versions + @if [[ $(shell node --version | sed 's/v//' | cut -d'.' -f1) -ge 18 ]]; then \ + echo "***Testing Cloudflare Worker support***"; \ + yarn vitest run -c test/vitest.config.mts test/cloudflare/ --no-watch -- $(params); \ + else \ + echo "Skipping test-worker: Node.js version is less than 18."; \ + fi diff --git a/packages/pg/test/cloudflare/vitest-cf.test.ts b/packages/pg/test/cloudflare/vitest-cf.test.ts index 3f2f8adb..177f0aed 100644 --- a/packages/pg/test/cloudflare/vitest-cf.test.ts +++ b/packages/pg/test/cloudflare/vitest-cf.test.ts @@ -5,7 +5,6 @@ import args from '../cli' test('default', async () => { const pool = new Pool(args) - const result = await pool.query('SELECT $1::text as name', ['cloudflare']) assert(result.rows[0].name === 'cloudflare') pool.end()