@@ -53,6 +53,72 @@ REQUIRED must have required property 'format'
5353 6 | ],]
5454`;
5555
56+ exports[`headers > should throw on additional property in headers 1`] = `
57+ [ManifestValidationError: Validation of Edge Functions manifest failed
58+ ADDTIONAL PROPERTY must NOT have additional properties
59+
60+ 33 | " x-custom-header" : {
61+ 34 | " style" : " exists" ,
62+ > 35 | " foo" : " bar"
63+ | ^^^^^ 😲 foo is not expected to be here !
64+ 36 | }
65+ 37 | }
66+ 38 | }]
67+ ` ;
68+
69+ exports[` headers > should throw on invalid pattern format 1 ` ] = `
70+ [ManifestValidationError : Validation of Edge Functions manifest failed
71+ FORMAT must match format " regexPattern"
72+
73+ 33 | " x-custom-header" : {
74+ 34 | " style" : " regex" ,
75+ > 35 | " pattern" : " /^Bearer .+/"
76+ | ^^^^^^^^^^^^^^ 👈🏽 format must match format " regexPattern"
77+ 36 | }
78+ 37 | }
79+ 38 | }]
80+ ` ;
81+
82+ exports[` headers > should throw on invalid style value 1 ` ] = `
83+ [ManifestValidationError : Validation of Edge Functions manifest failed
84+ ENUM must be equal to one of the allowed values
85+ (exists , missing , regex )
86+
87+ 32 | " headers" : {
88+ 33 | " x-custom-header" : {
89+ > 34 | " style" : " invalid"
90+ | ^^^^^^^^^ 👈🏽 Unexpected value , should be equal to one of the allowed values
91+ 35 | }
92+ 36 | }
93+ 37 | }]
94+ ` ;
95+
96+ exports[` headers > should throw on missing style property 1 ` ] = `
97+ [ManifestValidationError : Validation of Edge Functions manifest failed
98+ REQUIRED must have required property ' style'
99+
100+ 31 | " bundler_version" : " 1.6.0" ,
101+ 32 | " headers" : {
102+ > 33 | " x-custom-header" : {
103+ | ^ ☹️ style is missing here!
104+ 34 | " pattern" : " ^Bearer .+"
105+ 35 | }
106+ 36 | }]
107+ ` ;
108+
109+ exports[` headers > should throw when style is regex but pattern is missing 1 ` ] = `
110+ [ManifestValidationError : Validation of Edge Functions manifest failed
111+ REQUIRED must have required property ' pattern'
112+
113+ 31 | " bundler_version" : " 1.6.0" ,
114+ 32 | " headers" : {
115+ > 33 | " x-custom-header" : {
116+ | ^ ☹️ pattern is missing here!
117+ 34 | " style" : " regex"
118+ 35 | }
119+ 36 | }]
120+ ` ;
121+
56122exports[` import map URL > should throw on wrong type 1 ` ] = `
57123[ManifestValidationError : Validation of Edge Functions manifest failed
58124TYPE must be string
@@ -159,6 +225,72 @@ REQUIRED must have required property 'pattern'
159225 12 | " generator" : " @netlify/fake-plugin@1.0.0" ]
160226` ;
161227
228+ exports[` route headers > should throw on additional property in headers 1 ` ] = `
229+ [ManifestValidationError : Validation of Edge Functions manifest failed
230+ ADDTIONAL PROPERTY must NOT have additional properties
231+
232+ 15 | " x-custom-header" : {
233+ 16 | " style" : " exists" ,
234+ > 17 | " foo" : " bar"
235+ | ^^^^^ 😲 foo is not expected to be here !
236+ 18 | }
237+ 19 | }
238+ 20 | }]
239+ ` ;
240+
241+ exports[` route headers > should throw on invalid pattern format 1 ` ] = `
242+ [ManifestValidationError : Validation of Edge Functions manifest failed
243+ FORMAT must match format " regexPattern"
244+
245+ 15 | " x-custom-header" : {
246+ 16 | " style" : " regex" ,
247+ > 17 | " pattern" : " /^Bearer .+/"
248+ | ^^^^^^^^^^^^^^ 👈🏽 format must match format " regexPattern"
249+ 18 | }
250+ 19 | }
251+ 20 | }]
252+ ` ;
253+
254+ exports[` route headers > should throw on invalid style value 1 ` ] = `
255+ [ManifestValidationError : Validation of Edge Functions manifest failed
256+ ENUM must be equal to one of the allowed values
257+ (exists , missing , regex )
258+
259+ 14 | " headers" : {
260+ 15 | " x-custom-header" : {
261+ > 16 | " style" : " invalid"
262+ | ^^^^^^^^^ 👈🏽 Unexpected value , should be equal to one of the allowed values
263+ 17 | }
264+ 18 | }
265+ 19 | }]
266+ ` ;
267+
268+ exports[` route headers > should throw on missing style property 1 ` ] = `
269+ [ManifestValidationError : Validation of Edge Functions manifest failed
270+ REQUIRED must have required property ' style'
271+
272+ 13 | " generator" : " @netlify/fake-plugin@1.0.0" ,
273+ 14 | " headers" : {
274+ > 15 | " x-custom-header" : {
275+ | ^ ☹️ style is missing here!
276+ 16 | " pattern" : " ^Bearer .+$"
277+ 17 | }
278+ 18 | }]
279+ ` ;
280+
281+ exports[` route headers > should throw when style is regex but pattern is missing 1 ` ] = `
282+ [ManifestValidationError : Validation of Edge Functions manifest failed
283+ REQUIRED must have required property ' pattern'
284+
285+ 13 | " generator" : " @netlify/fake-plugin@1.0.0" ,
286+ 14 | " headers" : {
287+ > 15 | " x-custom-header" : {
288+ | ^ ☹️ pattern is missing here!
289+ 16 | " style" : " regex"
290+ 17 | }
291+ 18 | }]
292+ ` ;
293+
162294exports[` should show multiple errors 1 ` ] = `
163295[ManifestValidationError : Validation of Edge Functions manifest failed
164296ADDTIONAL PROPERTY must NOT have additional properties
0 commit comments