// test/index.test.ts
import app from '../src/index'
import { env } from 'cloudflare:test' // << not found error
import { expect, describe, it } from 'vitest'
describe('Test the application', () => {
it('Should return 200 response', async () => {
const res = await app.request('/', {}, env)
expect(res.status).toBe(200)
})
it('should return 404 for unknown routes', async () => {
const res = await app.request('/unknown', {});
expect(res.status).toBe(404);
})
// test/index.test.ts
import app from '../src/index'
import { env } from 'cloudflare:test' // << not found error
import { expect, describe, it } from 'vitest'
describe('Test the application', () => {
it('Should return 200 response', async () => {
const res = await app.request('/', {}, env)
expect(res.status).toBe(200)
})
it('should return 404 for unknown routes', async () => {
const res = await app.request('/unknown', {});
expect(res.status).toBe(404);
})