import app from "../src/index"
import { env } from 'cloudflare:test'
describe('Collections', () => {
test('POST /collections', async () => {
console.log(env)
const res = await app.request('/api/v1/collections', {
method: "POST",
body: JSON.stringify({
name: "collection",
status: "draft",
icon: "icon",
color: "red",
})
}, env)
console.log(await res.json())
// it should return a "{data: {...}, status: {...}}" object but returns an empty object
})
test('GET /collections', async () => {
console.log(env)
const res = await app.request('/api/v1/collections', {}, env)
console.log(await res.json())
// it should return an object {data: [...], status: {...}} where data has length = 3 but returns an empty object
})
})
import app from "../src/index"
import { env } from 'cloudflare:test'
describe('Collections', () => {
test('POST /collections', async () => {
console.log(env)
const res = await app.request('/api/v1/collections', {
method: "POST",
body: JSON.stringify({
name: "collection",
status: "draft",
icon: "icon",
color: "red",
})
}, env)
console.log(await res.json())
// it should return a "{data: {...}, status: {...}}" object but returns an empty object
})
test('GET /collections', async () => {
console.log(env)
const res = await app.request('/api/v1/collections', {}, env)
console.log(await res.json())
// it should return an object {data: [...], status: {...}} where data has length = 3 but returns an empty object
})
})