From a9b16bd9379a881bb7b875a1e56bffbd78440a6a Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 15 Aug 2020 17:26:13 -0400 Subject: Fix profile conditions unit test using old JsonSchema (#735) --- test/test-profile-conditions.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'test') 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); } -- cgit v1.2.3