From 0653b36b2b15b6f89c701d2143091e31c0315233 Mon Sep 17 00:00:00 2001 From: Sykander <26931543+Sykander@users.noreply.github.com> Date: Thu, 17 Nov 2022 14:55:36 +0000 Subject: [PATCH] Feature/ Controlled Execution - Cleaned up first test case --- tests/tests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tests.js b/tests/tests.js index b387695..6d4e70e 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -310,14 +310,14 @@ QUnit.module('basic', () => { QUnit.test("Expanding functionality with add_operator - controlledExecution", function(assert) { // assert that controlled execution doesn't do pre-evaluation - var customOp = function(values, data, jsonLogic) { - return jsonLogic.apply(values[0], data); + var customOp = function(values) { + return values[0]; } jsonLogic.add_operation('customOp', customOp, { controlledExecution: true }); - assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "" }, { "var": "test" }]}, { test: 123 }), { test: 123 }); - assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "test" }, { "var": "" }]}, { test: 123 }), 123); + assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "" }, { "var": "test" }]}, { test: 123 }), { var: "" }); + assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "test" }, { "var": "" }]}, { test: 123 }), { var: "test" }); // assert that controlled execution custom operators can be removed as normal jsonLogic.rm_operation('customOp');