File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ describe('Swagger', () => {
4545 ) . toBe ( true )
4646 } )
4747
48- it ( 'follow title and description' , async ( ) => {
48+ it ( 'follow title and description with Swagger-UI provider ' , async ( ) => {
4949 const app = new Elysia ( ) . use (
5050 swagger ( {
5151 version : '4.5.0' ,
@@ -75,6 +75,36 @@ describe('Swagger', () => {
7575 ) . toBe ( true )
7676 } )
7777
78+ it ( 'follow title and description with Scalar provider' , async ( ) => {
79+ const app = new Elysia ( ) . use (
80+ swagger ( {
81+ version : '4.5.0' ,
82+ provider : 'scalar' ,
83+ documentation : {
84+ info : {
85+ title : 'Elysia Documentation' ,
86+ description : 'Herrscher of Human' ,
87+ version : '1.0.0'
88+ }
89+ }
90+ } )
91+ )
92+
93+ await app . modules
94+
95+ const res = await app . handle ( req ( '/swagger' ) ) . then ( ( x ) => x . text ( ) )
96+
97+ expect ( res . includes ( '<title>Elysia Documentation</title>' ) ) . toBe ( true )
98+ expect (
99+ res . includes (
100+ `<meta
101+ name="description"
102+ content="Herrscher of Human"
103+ />`
104+ )
105+ ) . toBe ( true )
106+ } )
107+
78108 it ( 'use custom path' , async ( ) => {
79109 const app = new Elysia ( ) . use (
80110 swagger ( {
You can’t perform that action at this time.
0 commit comments