mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Skip worker tests on node below 18
This commit is contained in:
parent
42d00fa9f6
commit
cccda276e9
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user