mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
swagger ui options
This commit is contained in:
@@ -65,4 +65,21 @@ describe('Swagger', () => {
|
||||
const res = await app.handle(req('/v2/swagger'))
|
||||
expect(res.status).toBe(200)
|
||||
})
|
||||
|
||||
it('Swagger UI options', async () => {
|
||||
const app = new Elysia().use(
|
||||
swagger({
|
||||
swaggerOptions: {
|
||||
persistAuthorization: true
|
||||
}
|
||||
})
|
||||
)
|
||||
const res = await app.handle(req('/swagger')).then((x) => x.text())
|
||||
const expected = `
|
||||
window.onload = () => {
|
||||
window.ui = SwaggerUIBundle({"url":"/swagger/json","dom_id":"#swagger-ui","persistAuthorization":true});
|
||||
};
|
||||
`
|
||||
expect(res.trim().includes(expected.trim())).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user