diff --git a/src/enforcementLevel.ts b/src/enforcementLevel.ts index 842dd26..d76280d 100644 --- a/src/enforcementLevel.ts +++ b/src/enforcementLevel.ts @@ -28,6 +28,7 @@ export function isEnforcementLevel(o: any): o is EnforcementLevel { case "advisory": case "disabled": case "mandatory": + case "remediate": return true; default: return exhaustiveFalse(enforcementLevel); diff --git a/src/tests/util.ts b/src/tests/util.ts index 32f7e65..f2da4e8 100644 --- a/src/tests/util.ts +++ b/src/tests/util.ts @@ -103,6 +103,9 @@ async function runResourcePolicy(resPolicy: policy.ResourceValidationPolicy, arg ? resPolicy.validateResource : [resPolicy.validateResource]; for (const validation of validations) { + if (!validation) { + throw Error("validateResource must be a function or array of functions."); + } await Promise.resolve(validation(args, report)); } return violations;