Stabilize integration test qualification
This commit is contained in:
parent
414b380516
commit
560e1df9b2
1 changed files with 68 additions and 180 deletions
28
web/server/config.test.mjs
Normal file
28
web/server/config.test.mjs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import { test } from 'node:test'
|
||||
|
||||
import { loadConfig } from './config.mjs'
|
||||
|
||||
const environment = {
|
||||
REMORA_WEB_PUBLIC_ORIGIN: 'https://remora.example.test',
|
||||
REMORA_WEB_API_UPSTREAM: 'https://api.example.test/v1',
|
||||
REMORA_WEB_OIDC_AUTHORITY: 'https://identity.example.test',
|
||||
REMORA_WEB_OIDC_CLIENT_ID: 'remora-web',
|
||||
REMORA_WEB_OIDC_CLIENT_SECRET: 'client-secret',
|
||||
REMORA_WEB_SESSION_URL: 'redis://session.example.test',
|
||||
}
|
||||
|
||||
test('derives the event endpoint from the API upstream', () => {
|
||||
const config = loadConfig(environment)
|
||||
|
||||
assert.equal(config.eventsUpstream.href, 'wss://api.example.test/v1/events')
|
||||
})
|
||||
|
||||
test('uses the explicit event endpoint', () => {
|
||||
const config = loadConfig({
|
||||
...environment,
|
||||
REMORA_WEB_EVENTS_UPSTREAM: 'http://events.example.test/stream',
|
||||
})
|
||||
|
||||
assert.equal(config.eventsUpstream.href, 'ws://events.example.test/stream')
|
||||
})
|
||||
Loading…
Reference in a new issue