@@ -91,7 +91,8 @@ test('parses bare minimum valid config successfully', () => {
9191
9292test ( 'errors if title is missing' , ( ) => {
9393 expect ( ( ) =>
94- parseStarlightConfigWithFriendlyErrors ( { } as any )
94+ // @ts -expect-error - Testing invalid config
95+ parseStarlightConfigWithFriendlyErrors ( { } )
9596 ) . toThrowErrorMatchingInlineSnapshot (
9697 `
9798 "[AstroUserError]:
@@ -105,7 +106,8 @@ test('errors if title is missing', () => {
105106
106107test ( 'errors if title value is not a string or an Object' , ( ) => {
107108 expect ( ( ) =>
108- parseStarlightConfigWithFriendlyErrors ( { title : 5 } as any )
109+ // @ts -expect-error - Testing invalid config
110+ parseStarlightConfigWithFriendlyErrors ( { title : 5 } )
109111 ) . toThrowErrorMatchingInlineSnapshot (
110112 `
111113 "[AstroUserError]:
@@ -119,7 +121,8 @@ test('errors if title value is not a string or an Object', () => {
119121
120122test ( 'errors with bad social icon config' , ( ) => {
121123 expect ( ( ) =>
122- parseStarlightConfigWithFriendlyErrors ( { title : 'Test' , social : { unknown : '' } as any } )
124+ // @ts -expect-error - Testing invalid config
125+ parseStarlightConfigWithFriendlyErrors ( { title : 'Test' , social : { unknown : '' } } )
123126 ) . toThrowErrorMatchingInlineSnapshot (
124127 `
125128 "[AstroUserError]:
@@ -135,7 +138,8 @@ test('errors with bad social icon config', () => {
135138
136139test ( 'errors with bad logo config' , ( ) => {
137140 expect ( ( ) =>
138- parseStarlightConfigWithFriendlyErrors ( { title : 'Test' , logo : { html : '' } as any } )
141+ // @ts -expect-error - Testing invalid config
142+ parseStarlightConfigWithFriendlyErrors ( { title : 'Test' , logo : { html : '' } } )
139143 ) . toThrowErrorMatchingInlineSnapshot (
140144 `
141145 "[AstroUserError]:
@@ -152,7 +156,8 @@ test('errors with bad head config', () => {
152156 expect ( ( ) =>
153157 parseStarlightConfigWithFriendlyErrors ( {
154158 title : 'Test' ,
155- head : [ { tag : 'unknown' , attrs : { prop : null } , content : 20 } as any ] ,
159+ // @ts -expect-error - Testing invalid config
160+ head : [ { tag : 'unknown' , attrs : { prop : null } , content : 20 } ] ,
156161 } )
157162 ) . toThrowErrorMatchingInlineSnapshot (
158163 `
@@ -171,7 +176,8 @@ test('errors with bad sidebar config', () => {
171176 expect ( ( ) =>
172177 parseStarlightConfigWithFriendlyErrors ( {
173178 title : 'Test' ,
174- sidebar : [ { label : 'Example' , href : '/' } as any ] ,
179+ // @ts -expect-error - Testing invalid config
180+ sidebar : [ { label : 'Example' , href : '/' } ] ,
175181 } )
176182 ) . toThrowErrorMatchingInlineSnapshot (
177183 `
@@ -194,9 +200,10 @@ test('errors with bad nested sidebar config', () => {
194200 label : 'Example' ,
195201 items : [
196202 { label : 'Nested Example 1' , link : '/' } ,
203+ // @ts -expect-error - Testing invalid config
197204 { label : 'Nested Example 2' , link : true } ,
198205 ] ,
199- } as any ,
206+ } ,
200207 ] ,
201208 } )
202209 ) . toThrowErrorMatchingInlineSnapshot ( `
0 commit comments