File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -183,9 +183,10 @@ export default {
183183 },
184184 },
185185 },
186+ additionalProperties: false,
186187 },
187- additionalProperties: false,
188188 },
189+ required: ["url", "events"],
189190 },
190191 },
191192 additionalProperties: false,
Original file line number Diff line number Diff line change @@ -202,9 +202,10 @@ export default {
202202 },
203203 },
204204 },
205+ additionalProperties: false,
205206 },
206- additionalProperties: false,
207207 },
208+ required: ["url", "events"],
208209 },
209210 },
210211 additionalProperties: false,
Original file line number Diff line number Diff line change @@ -197,6 +197,38 @@ describe('validate skeleton', () => {
197197 const valid = validateSkeleton(json)
198198 expect(valid).toBe(false)
199199 })
200+ it('should fail if webhook url is missing', () => {
201+ const json = {
202+ ...validJson,
203+ config: {
204+ ...validJson.config,
205+ webhook: {
206+ events: {}
207+ }
208+ }
209+ }
210+
211+ const valid = validateSkeleton(json)
212+ expect(valid).toBe(false)
213+ })
214+ it('should fail if webhook events include non-listed events', () => {
215+ const json = {
216+ ...validJson,
217+ config: {
218+ ...validJson.config,
219+ webhook: {
220+ ...validJson.config.webhook,
221+ events: {
222+ ...validJson.config.webhook.events,
223+ not_an_event: true,
224+ }
225+ }
226+ }
227+ }
228+
229+ const valid = validateSkeleton(json)
230+ expect(valid).toBe(false)
231+ })
200232 it('should fail if level is missing id', () => {
201233 const level1 = { ...validJson.levels[0], id: undefined }
202234 const json = {
You can’t perform that action at this time.
0 commit comments