diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-08-15 17:26:13 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-15 17:26:13 -0400 | 
| commit | a9b16bd9379a881bb7b875a1e56bffbd78440a6a (patch) | |
| tree | 18a9eb0ff61eb6320cc20beea1424475bc9526bb | |
| parent | d582c7a0f856c1a352992e3d16be319a891e0202 (diff) | |
Fix profile conditions unit test using old JsonSchema (#735)
| -rw-r--r-- | test/test-profile-conditions.js | 9 | 
1 files changed, 2 insertions, 7 deletions
| diff --git a/test/test-profile-conditions.js b/test/test-profile-conditions.js index ce26cbb4..d7402acf 100644 --- a/test/test-profile-conditions.js +++ b/test/test-profile-conditions.js @@ -26,16 +26,11 @@ vm.execute([      'bg/js/json-schema.js',      'bg/js/profile-conditions2.js'  ]); -const [JsonSchema, ProfileConditions] = vm.get(['JsonSchema', 'ProfileConditions']); +const [JsonSchemaValidator, ProfileConditions] = vm.get(['JsonSchemaValidator', 'ProfileConditions']);  function schemaValidate(value, schema) { -    try { -        JsonSchema.validate(value, schema); -        return true; -    } catch (e) { -        return false; -    } +    return new JsonSchemaValidator().isValid(value, schema);  } |