Fix profile conditions unit test using old JsonSchema (#735)

This commit is contained in:
toasted-nutbread 2020-08-15 17:26:13 -04:00 committed by GitHub
parent d582c7a0f8
commit a9b16bd937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}