add more endpoints

This commit is contained in:
Devin Zuczek
2026-06-11 02:10:01 -04:00
parent 0fea1fff14
commit 4a97e05866
37 changed files with 55656 additions and 16 deletions
@@ -0,0 +1,22 @@
import { exports } from 'cloudflare:workers'
import { describe, expect, test } from 'vitest'
import '../../econ.app'
const ORIGIN = 'https://econ.rec.djdevin.net'
describe('econ endpoints', () => {
test('GET /api/avatar/v1/defaultunlocked returns the default avatar items', async () => {
const res = await exports.default.fetch(`${ORIGIN}/api/avatar/v1/defaultunlocked`)
expect(res.status).toBe(200)
const body = (await res.json()) as unknown[]
expect(Array.isArray(body)).toBe(true)
expect(body.length).toBeGreaterThan(0)
expect(body[0]).toHaveProperty('AvatarItemDesc')
})
test('unknown path returns 404', async () => {
const res = await exports.default.fetch(`${ORIGIN}/nope`)
expect(res.status).toBe(404)
})
})