[tests] fix drift

This commit is contained in:
Devin Zuczek
2026-08-25 11:42:29 -04:00
parent f9ffbcd374
commit 3b5e47c39d
2 changed files with 11 additions and 2 deletions
@@ -1247,6 +1247,7 @@ describe('auth worker routes', () => {
expect([...documented].sort()).toEqual([ expect([...documented].sort()).toEqual([
'GET /cachedlogin/forplatformid/{platform}/{id}', 'GET /cachedlogin/forplatformid/{platform}/{id}',
'GET /eac/challenge', 'GET /eac/challenge',
'GET /oculus/nonce',
'GET /privileges/me/restrictions', 'GET /privileges/me/restrictions',
'GET /role/developer/{id}', 'GET /role/developer/{id}',
'GET /role/moderator/{id}', 'GET /role/moderator/{id}',
+10 -2
View File
@@ -1,5 +1,6 @@
import { adminSecretsStore, env } from 'cloudflare:test'
import { exports } from 'cloudflare:workers' import { exports } from 'cloudflare:workers'
import { describe, expect, test } from 'vitest' import { beforeAll, describe, expect, test } from 'vitest'
import type { Env } from '../../context' import type { Env } from '../../context'
@@ -11,9 +12,16 @@ const ORIGIN = 'https://example.com'
// The facade's job is routing, not business logic, so one request that reaches a // The facade's job is routing, not business logic, so one request that reaches a
// mounted app through the path prefix is enough to prove the wiring. `api` serves a // mounted app through the path prefix is enough to prove the wiring. `api` serves a
// static game-config with no auth/DB, so it's a clean target. The api worker namespaces // static game-config with no DB behind it, so it's a clean target. The api worker namespaces
// its own routes under `/api`, hence the `/api` prefix (service) + `/api/...` (real path). // its own routes under `/api`, hence the `/api` prefix (service) + `/api/...` (real path).
describe('mono routing', () => { describe('mono routing', () => {
// `gameconfigs` reads the token's build claim to pick which catalog to serve, so it
// resolves JWT_SECRET even for an unauthenticated request. Seed the key into the local
// Secrets Store or the handler throws before the routing assertion can run.
beforeAll(async () => {
await adminSecretsStore(env.JWT_SECRET).create('test-signing-key')
})
test('path prefix routes to the api worker (gameconfigs)', async () => { test('path prefix routes to the api worker (gameconfigs)', async () => {
const res = await exports.default.fetch(`${ORIGIN}/api/api/gameconfigs/v1/all`) const res = await exports.default.fetch(`${ORIGIN}/api/api/gameconfigs/v1/all`)
expect(res.status).toBe(200) expect(res.status).toBe(200)