Files
2025-02-16 17:53:05 +07:00

25 lines
544 B
TypeScript

import { Elysia } from '../../src'
import { describe, expect, it } from 'bun:test'
import { req } from '../utils'
describe('Plugin', () => {
it('await async nested plugin', async () => {
const yay = async () => {
await Bun.sleep(2)
return new Elysia({ name: 'yay' }).get('/yay', 'yay')
}
const wrapper = new Elysia({ name: 'wrapper' }).use(yay())
const app = new Elysia().use(wrapper)
await app.modules
const response = await app.handle(req('/yay'))
expect(response.status).toBe(200)
})
})