Skip to content

Commit 0653b36

Browse files
committed
Feature/ Controlled Execution
- Cleaned up first test case
1 parent 8ceab06 commit 0653b36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/tests.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ QUnit.module('basic', () => {
310310

311311
QUnit.test("Expanding functionality with add_operator - controlledExecution", function(assert) {
312312
// assert that controlled execution doesn't do pre-evaluation
313-
var customOp = function(values, data, jsonLogic) {
314-
return jsonLogic.apply(values[0], data);
313+
var customOp = function(values) {
314+
return values[0];
315315
}
316316

317317
jsonLogic.add_operation('customOp', customOp, { controlledExecution: true });
318318

319-
assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "" }, { "var": "test" }]}, { test: 123 }), { test: 123 });
320-
assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "test" }, { "var": "" }]}, { test: 123 }), 123);
319+
assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "" }, { "var": "test" }]}, { test: 123 }), { var: "" });
320+
assert.deepEqual(jsonLogic.apply({ customOp: [{ "var": "test" }, { "var": "" }]}, { test: 123 }), { var: "test" });
321321

322322
// assert that controlled execution custom operators can be removed as normal
323323
jsonLogic.rm_operation('customOp');

0 commit comments

Comments
 (0)