Skip to content

Commit c53f47d

Browse files
committed
Add some additional checks to and, one that includes empty object as truthy, I can change this if needed.
1 parent ff905c0 commit c53f47d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

suites/control/and.json

+12
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@
4242
"data": null,
4343
"result": false
4444
},
45+
{
46+
"description": "When all values are truthy, the last truthy value should be returned",
47+
"rule": { "and": [1, 2, 3] },
48+
"data": null,
49+
"result": 3
50+
},
51+
{
52+
"description": "When all values are truthy, the last truthy value should be returned (2)",
53+
"rule": { "and": [true, 1, {}] },
54+
"data": null,
55+
"result": {}
56+
},
4557
{
4658
"description": "And with a single falsey value should be return the falsy value",
4759
"rule": { "and": [[]] },

0 commit comments

Comments
 (0)