File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -65,4 +65,20 @@ describe("v1_versions", () => {
6565 expect ( Array . isArray ( data ) ) . toBe ( true ) ;
6666 expect ( data . every ( ( version ) => ! version . draft ) ) . toBe ( true ) ;
6767 } ) ;
68+
69+ it . todo ( "should return 404 when no draft versions are available" , async ( ) => {
70+ const request = new Request ( "https://api.mojis.dev/api/v1/versions/draft" ) ;
71+ const ctx = createExecutionContext ( ) ;
72+ const response = await worker . fetch ( request , env , ctx ) ;
73+ await waitOnExecutionContext ( ctx ) ;
74+
75+ expect ( response . status ) . toBe ( 404 ) ;
76+ const data = await response . json ( ) ;
77+ expect ( data ) . toMatchObject ( {
78+ message : expect . any ( String ) ,
79+ status : 404 ,
80+ path : "/api/v1/versions/draft" ,
81+ timestamp : expect . any ( String ) ,
82+ } ) ;
83+ } ) ;
6884} ) ;
You can’t perform that action at this time.
0 commit comments