aboutsummaryrefslogtreecommitdiff
path: root/test/test-profile-conditions-util.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-profile-conditions-util.js')
-rw-r--r--test/test-profile-conditions-util.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/test-profile-conditions-util.js b/test/test-profile-conditions-util.js
index b77578de..2d076a7f 100644
--- a/test/test-profile-conditions-util.js
+++ b/test/test-profile-conditions-util.js
@@ -27,12 +27,7 @@ vm.execute([
'js/data/json-schema.js',
'js/background/profile-conditions-util.js'
]);
-const [JsonSchemaValidator, ProfileConditionsUtil] = vm.get(['JsonSchemaValidator', 'ProfileConditionsUtil']);
-
-
-function schemaValidate(value, schema) {
- return new JsonSchemaValidator().isValid(value, schema);
-}
+const [ProfileConditionsUtil] = vm.get(['ProfileConditionsUtil']);
function testNormalizeContext() {
@@ -1081,12 +1076,12 @@ function testSchemas() {
const profileConditionsUtil = new ProfileConditionsUtil();
const schema = profileConditionsUtil.createSchema(conditionGroups);
if (typeof expectedSchema !== 'undefined') {
- vm.assert.deepStrictEqual(schema, expectedSchema);
+ vm.assert.deepStrictEqual(schema.schema, expectedSchema);
}
if (Array.isArray(inputs)) {
for (const {expected, context} of inputs) {
const normalizedContext = profileConditionsUtil.normalizeContext(context);
- const actual = schemaValidate(normalizedContext, schema);
+ const actual = schema.isValid(normalizedContext);
assert.strictEqual(actual, expected);
}
}