mirror of
https://github.com/michivonah/themepark-assistant.git
synced 2025-12-22 22:16:29 +01:00
41 lines
No EOL
960 B
TypeScript
41 lines
No EOL
960 B
TypeScript
import { env } from 'cloudflare:test'
|
|
import { app } from '../src/index'
|
|
|
|
// describe('Example', () => {
|
|
// it('Should return 200 response', async () => {
|
|
// const res = await app.request('/hello', {}, env)
|
|
|
|
// expect(res.status).toBe(200)
|
|
// expect(await res.json()).toEqual({
|
|
// hello: 'world',
|
|
// var: 'my variable',
|
|
// })
|
|
// })
|
|
// })
|
|
|
|
|
|
|
|
describe('Authentication', () => {
|
|
it('Should return 200 response', async () => {
|
|
const res = await app.request('/themepark/list', {
|
|
headers: {
|
|
Cookie: `authjs.session-token=${env.SESSION_TOKEN}`
|
|
}
|
|
}, env)
|
|
|
|
expect(res.status).toBe(200)
|
|
// expect(await res.json()).toEqual({
|
|
// hello: 'world',
|
|
// var: 'my variable',
|
|
// })
|
|
})
|
|
})
|
|
|
|
|
|
// describe('Example', () => {
|
|
// it('Should return 200 response', async () => {
|
|
// const res = await app.request('/protected', {}, env)
|
|
|
|
// expect(res.status).toBe(200)
|
|
// })
|
|
// })
|