mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-09 23:21:30 -07:00
add rooms
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { SELF } from 'cloudflare:test'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import '../../datacollection.app'
|
||||
|
||||
const ORIGIN = 'https://datacollection.rec.djdevin.net'
|
||||
|
||||
describe('datacollection endpoints', () => {
|
||||
it('GET / reports service status', async () => {
|
||||
const res = await SELF.fetch(`${ORIGIN}/`)
|
||||
expect(res.status).toBe(200)
|
||||
expect(await res.json()).toEqual({ service: 'datacollection', status: 'ok' })
|
||||
})
|
||||
|
||||
it('POST /data/event accepts an event and returns 200', async () => {
|
||||
const res = await SELF.fetch(`${ORIGIN}/data/event`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name: 'app_start', properties: { foo: 'bar' } }),
|
||||
})
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
it('POST /data/event accepts an empty body', async () => {
|
||||
const res = await SELF.fetch(`${ORIGIN}/data/event`, { method: 'POST' })
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
it('POST /data/heartbeat returns 200', async () => {
|
||||
const res = await SELF.fetch(`${ORIGIN}/data/heartbeat`, { method: 'POST' })
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user