@@ -54,6 +54,27 @@ describe("parseOptions", async () => {
5454 } ) ;
5555 } ) ;
5656
57+ await it ( "rejects a missing --body" , ( ) => {
58+ assert . throws (
59+ ( ) => parseOptions ( withoutFlag ( "--body" ) ) ,
60+ / M i s s i n g r e q u i r e d f l a g - - b o d y / ,
61+ ) ;
62+ } ) ;
63+
64+ await it ( "rejects an empty --body" , ( ) => {
65+ assert . throws (
66+ ( ) => parseOptions ( withFlag ( "--body" , "" ) ) ,
67+ / T h e v a l u e f o r - - b o d y c a n n o t b e e m p t y / ,
68+ ) ;
69+ } ) ;
70+
71+ await it ( "rejects a whitespace-only --body" , ( ) => {
72+ assert . throws (
73+ ( ) => parseOptions ( withFlag ( "--body" , " \t\n" ) ) ,
74+ / T h e v a l u e f o r - - b o d y c a n n o t b e e m p t y / ,
75+ ) ;
76+ } ) ;
77+
5778 await it ( "rejects a missing --marker" , ( ) => {
5879 assert . throws (
5980 ( ) => parseOptions ( withoutFlag ( "--marker" ) ) ,
@@ -74,6 +95,34 @@ describe("parseOptions", async () => {
7495 / T h e v a l u e f o r - - m a r k e r c a n n o t b e e m p t y / ,
7596 ) ;
7697 } ) ;
98+
99+ await it ( "rejects a missing --repository" , ( ) => {
100+ assert . throws (
101+ ( ) => parseOptions ( withoutFlag ( "--repository" ) ) ,
102+ / M i s s i n g r e q u i r e d f l a g - - r e p o s i t o r y / ,
103+ ) ;
104+ } ) ;
105+
106+ await it ( "rejects an empty --repository" , ( ) => {
107+ assert . throws (
108+ ( ) => parseOptions ( withFlag ( "--repository" , "" ) ) ,
109+ / T h e v a l u e f o r - - r e p o s i t o r y c a n n o t b e e m p t y / ,
110+ ) ;
111+ } ) ;
112+
113+ await it ( "rejects a whitespace-only --repository" , ( ) => {
114+ assert . throws (
115+ ( ) => parseOptions ( withFlag ( "--repository" , " \t\n" ) ) ,
116+ / T h e v a l u e f o r - - r e p o s i t o r y c a n n o t b e e m p t y / ,
117+ ) ;
118+ } ) ;
119+
120+ await it ( "rejects an invalid --repository value" , ( ) => {
121+ assert . throws (
122+ ( ) => parseOptions ( withFlag ( "--repository" , "github/codeql/action" ) ) ,
123+ / I n v a l i d - - r e p o s i t o r y v a l u e / ,
124+ ) ;
125+ } ) ;
77126} ) ;
78127
79128describe ( "resolveToken" , async ( ) => {
0 commit comments