[leaderboard] add stub

This commit is contained in:
Devin Zuczek
2026-08-21 15:10:11 -04:00
parent 0699e4409e
commit dcaff859d0
12 changed files with 14867 additions and 1 deletions
@@ -0,0 +1,17 @@
import { SELF } from 'cloudflare:test'
import { expect, it } from 'vitest'
it('response with hello world', async () => {
const res = await SELF.fetch('https://example.com')
expect(res.status).toBe(200)
expect(await res.text()).toMatchInlineSnapshot(`"hello, world!"`)
})
it('answers GetNearbyScores with an empty row list', async () => {
const res = await SELF.fetch('https://example.com/leaderboard/GetNearbyScores', {
method: 'POST',
body: JSON.stringify({}),
})
expect(res.status).toBe(200)
expect(await res.json()).toEqual({ Rows: [] })
})