diff options
Diffstat (limited to 'tests/js')
-rw-r--r-- | tests/js/utils.mjs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/js/utils.mjs b/tests/js/utils.mjs index 12b444b..ea5f4eb 100644 --- a/tests/js/utils.mjs +++ b/tests/js/utils.mjs @@ -6,7 +6,7 @@ import { difference, assocIn, getIn, - first, + findFirst, partial, strSortFn, undefinedAsNull, @@ -139,20 +139,20 @@ const test_getIn = t => { }); }; -const test_first = t => { - t.start("first()"); +const test_findFirst = t => { + t.start("findFirst()"); t.test("empty values", () => { - assert.equal(first([], () => {}), null); + assert.equal(findFirst([], () => {}), null); }); t.test("when function doesn't transform, it behaves similarly to [].find()", () => { const arr1 = [ 0, null, undefined, "", 1, 2 ]; - assert.equal(first(arr1, x => x), 1); + assert.equal(findFirst(arr1, x => x), 1); assert.equal(arr1.find(x => x), 1); const arr2 = [ 0, null, undefined, "", false ]; - assert.equal(first(arr2, x => x), null); + assert.equal(findFirst(arr2, x => x), null); assert.equal(arr2.find(x => x), undefined); }); @@ -160,7 +160,7 @@ const test_first = t => { const arr = [ 1, 3, 5, 6 ]; assert.equal( - first(arr, x => x % 2 === 0 && "a brand new value"), + findFirst(arr, x => x % 2 === 0 && "a brand new value"), "a brand new value", ); }); @@ -274,7 +274,7 @@ await runner.runTests([ test_difference, test_assocIn, test_getIn, - test_first, + test_findFirst, test_partial, test_strSortFn, test_undefinedAsNull, |