mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:05:19 +00:00
Adds electoral nuclei, leaderships, updates, and WhatsApp invite flows behind campaign auth, plus the consolidated schema migration that Vercel applies on deploy.
28 lines
1 KiB
TypeScript
28 lines
1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { assertTestDatabase } from '../helpers/assertTestDatabase'
|
|
|
|
describe('assertTestDatabase', () => {
|
|
it.each([
|
|
'postgresql://teqo:teqo@localhost:5432/teqo_test',
|
|
'postgresql://teqo:teqo@127.0.0.1:5432/teqo_test',
|
|
'postgresql://teqo:teqo@[::1]:5432/teqo_test',
|
|
])('accepts the exact local test database at %s', (databaseUrl) => {
|
|
expect(() => assertTestDatabase(databaseUrl)).not.toThrow()
|
|
})
|
|
|
|
it.each([
|
|
'postgresql://teqo:teqo@localhost:5432/other_test',
|
|
'postgresql://teqo:teqo@localhost:5432/teqo',
|
|
'postgresql://teqo:teqo@db.example.com:5432/teqo_test',
|
|
'postgresql://teqo:teqo@neon.example.com:5432/other_test',
|
|
'postgres://teqo:teqo@localhost:5432/teqo_test',
|
|
'https://localhost/teqo_test',
|
|
'postgresql+srv://teqo:teqo@localhost:5432/teqo_test',
|
|
'postgresql://teqo:teqo@localhost:5432/teqo_test/extra',
|
|
'not-a-url',
|
|
undefined,
|
|
])('rejects unsafe database URL %s', (databaseUrl) => {
|
|
expect(() => assertTestDatabase(databaseUrl)).toThrow()
|
|
})
|
|
})
|