diff --git a/collections/aggregate_groups_test.ts b/collections/aggregate_groups_test.ts index 44f48c93f8b0..667ece7dfdbe 100644 --- a/collections/aggregate_groups_test.ts +++ b/collections/aggregate_groups_test.ts @@ -16,7 +16,7 @@ function aggregateGroupsTest( } Deno.test({ - name: "[collections/aggregateGroups] no mutation", + name: "aggregateGroups() handles no mutation", fn() { const input = { Woody: [2, 3, 1, 4], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/aggregateGroups] string building using all params", + name: "aggregateGroups() handles string building using all params", fn() { aggregateGroupsTest( [ @@ -58,7 +58,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/aggregateGroups] sum ignoring non reduce params", + name: "aggregateGroups() handles sum ignoring non reduce params", fn() { aggregateGroupsTest( [ @@ -77,7 +77,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/aggregateGroups] empty input", + name: "aggregateGroups() handles empty input", fn() { aggregateGroupsTest([ {}, diff --git a/collections/associate_by_test.ts b/collections/associate_by_test.ts index 8212f6189824..a80698d66c49 100644 --- a/collections/associate_by_test.ts +++ b/collections/associate_by_test.ts @@ -13,7 +13,7 @@ function associateByTest( } Deno.test({ - name: "[collections/associateBy] no mutation", + name: "associateBy() handles no mutation", fn() { const arrayA = ["Foo", "Bar"]; associateBy(arrayA, (it) => it.charAt(0)); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateBy] empty input", + name: "associateBy() handles empty input", fn() { associateByTest( [[], () => "a"], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateBy] constant key", + name: "associateBy() handles constant key", fn() { associateByTest( [[1, 3, 5, 6], () => "a"], @@ -43,7 +43,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateBy] empty key", + name: "associateBy() handles empty key", fn() { associateByTest( [ @@ -59,7 +59,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateBy] duplicate keys", + name: "associateBy() handles duplicate keys", fn() { associateByTest( [ @@ -87,7 +87,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateBy] associates", + name: "associateBy() handles associates", fn() { associateByTest( [ diff --git a/collections/associate_with_test.ts b/collections/associate_with_test.ts index ec5b87e42831..264ac7d5b35a 100644 --- a/collections/associate_with_test.ts +++ b/collections/associate_with_test.ts @@ -13,7 +13,7 @@ function associateWithTest( } Deno.test({ - name: "[collections/associateWith] no mutation", + name: "associateWith() handles no mutation", fn() { const arrayA = ["Foo", "Bar"]; associateWith(arrayA, (it) => it.charAt(0)); @@ -23,14 +23,14 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateWith] empty input", + name: "associateWith() handles empty input", fn() { associateWithTest([[], () => "abc"], {}); }, }); Deno.test({ - name: "[collections/associateWith] associates", + name: "associateWith() handles associates", fn() { associateWithTest( [ @@ -81,7 +81,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/associateWith] duplicate keys", + name: "associateWith() handles duplicate keys", fn() { associateWithTest( [ diff --git a/collections/chunk_test.ts b/collections/chunk_test.ts index 09fb8a72e54e..9c85f48039a3 100644 --- a/collections/chunk_test.ts +++ b/collections/chunk_test.ts @@ -15,7 +15,7 @@ function chunkTest( const testArray = [1, 2, 3, 4, 5, 6]; Deno.test({ - name: "[collections/chunk] no mutation", + name: "chunk() handles no mutation", fn() { const array = [1, 2, 3, 4]; chunk(array, 2); @@ -25,7 +25,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/chunk] throws on non naturals", + name: "chunk() throws on non naturals", fn() { assertThrows(() => chunk([], +.5)); assertThrows(() => chunk([], -4.7)); @@ -36,7 +36,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/chunk] empty input", + name: "chunk() handles empty input", fn() { chunkTest( [[], 1], @@ -46,7 +46,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/chunk] single element chunks", + name: "chunk() handles single element chunks", fn() { chunkTest( [testArray, 1], @@ -60,7 +60,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/chunk] n chunks fitting", + name: "chunk() handles n chunks fitting", fn() { chunkTest( [testArray, 2], @@ -74,7 +74,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/chunk] n chunks not fitting", + name: "chunk() handles n chunks not fitting", fn() { chunkTest( [testArray, 4], @@ -88,7 +88,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/chunk] chunks equal to length", + name: "chunk() handles chunks equal to length", fn() { chunkTest( [testArray, testArray.length], diff --git a/collections/deep_merge_test.ts b/collections/deep_merge_test.ts index 72c9c983a53f..25999378c4a0 100644 --- a/collections/deep_merge_test.ts +++ b/collections/deep_merge_test.ts @@ -2,7 +2,7 @@ import { assertEquals, assertStrictEquals } from "../assert/mod.ts"; import { deepMerge } from "./deep_merge.ts"; -Deno.test("deepMerge: simple merge", () => { +Deno.test("deepMerge() handles simple merge", () => { assertEquals( deepMerge({ foo: true, @@ -16,7 +16,7 @@ Deno.test("deepMerge: simple merge", () => { ); }); -Deno.test("deepMerge: symbol merge", () => { +Deno.test("deepMerge() handles symbol merge", () => { assertEquals( deepMerge({}, { [Symbol.for("deepmerge.test")]: true, @@ -27,7 +27,7 @@ Deno.test("deepMerge: symbol merge", () => { ); }); -Deno.test("deepMerge: ignore non enumerable", () => { +Deno.test("deepMerge() ignores non enumerable", () => { assertEquals( deepMerge( {}, @@ -42,7 +42,7 @@ Deno.test("deepMerge: ignore non enumerable", () => { ); }); -Deno.test("deepMerge: nested merge", () => { +Deno.test("deepMerge() handles nested merge", () => { assertEquals( deepMerge({ foo: { @@ -66,7 +66,7 @@ Deno.test("deepMerge: nested merge", () => { ); }); -Deno.test("deepMerge: prevent prototype merge", () => { +Deno.test("deepMerge() prevents prototype merge", () => { assertEquals( deepMerge({ constructor: undefined, @@ -80,7 +80,7 @@ Deno.test("deepMerge: prevent prototype merge", () => { ); }); -Deno.test("deepMerge: prevent calling Object.prototype.__proto__ accessor property", () => { +Deno.test("deepMerge() prevents calling Object.prototype.__proto__ accessor property", () => { Object.defineProperty(Object.prototype, "__proto__", { get() { throw new Error( @@ -113,7 +113,7 @@ Deno.test("deepMerge: prevent calling Object.prototype.__proto__ accessor proper } }); -Deno.test("deepMerge: override target (non-mergeable source)", () => { +Deno.test("deepMerge() overrides target (non-mergeable source)", () => { assertEquals( deepMerge({ foo: { @@ -128,7 +128,7 @@ Deno.test("deepMerge: override target (non-mergeable source)", () => { ); }); -Deno.test("deepMerge: override target (non-mergeable destination, object like)", () => { +Deno.test("deepMerge() overrides target (non-mergeable destination, object like)", () => { const CustomClass = class {}; assertEquals( deepMerge({ @@ -142,7 +142,7 @@ Deno.test("deepMerge: override target (non-mergeable destination, object like)", ); }); -Deno.test("deepMerge: override target (non-mergeable destination, array like)", () => { +Deno.test("deepMerge() overrides target (non-mergeable destination, array like)", () => { assertEquals( deepMerge({ foo: [], @@ -155,7 +155,7 @@ Deno.test("deepMerge: override target (non-mergeable destination, array like)", ); }); -Deno.test("deepMerge: override target (different object like source and destination)", () => { +Deno.test("deepMerge() overrides target (different object like source and destination)", () => { assertEquals( deepMerge({ foo: {}, @@ -178,7 +178,7 @@ Deno.test("deepMerge: override target (different object like source and destinat ); }); -Deno.test("deepMerge: primitive types handling", () => { +Deno.test("deepMerge() handles primitive types handling", () => { const CustomClass = class {}; const expected = { boolean: true, @@ -221,7 +221,7 @@ Deno.test("deepMerge: primitive types handling", () => { ); }); -Deno.test("deepMerge: array merge (replace)", () => { +Deno.test("deepMerge() handles array merge (replace)", () => { assertEquals( deepMerge({ foo: [1, 2, 3], @@ -234,7 +234,7 @@ Deno.test("deepMerge: array merge (replace)", () => { ); }); -Deno.test("deepMerge: array merge (merge)", () => { +Deno.test("deepMerge() handles array merge (merge)", () => { assertEquals( deepMerge({ foo: [1, 2, 3], @@ -247,7 +247,7 @@ Deno.test("deepMerge: array merge (merge)", () => { ); }); -Deno.test("deepMerge: maps merge (replace)", () => { +Deno.test("deepMerge() handles maps merge (replace)", () => { assertEquals( deepMerge({ map: new Map([["foo", true]]), @@ -260,7 +260,7 @@ Deno.test("deepMerge: maps merge (replace)", () => { ); }); -Deno.test("deepMerge: maps merge (merge)", () => { +Deno.test("deepMerge() handles maps merge (merge)", () => { assertEquals( deepMerge({ map: new Map([["foo", true]]), @@ -273,7 +273,7 @@ Deno.test("deepMerge: maps merge (merge)", () => { ); }); -Deno.test("deepMerge: sets merge (replace)", () => { +Deno.test("deepMerge() handles sets merge (replace)", () => { assertEquals( deepMerge({ set: new Set(["foo"]), @@ -286,7 +286,7 @@ Deno.test("deepMerge: sets merge (replace)", () => { ); }); -Deno.test("deepMerge: sets merge (merge)", () => { +Deno.test("deepMerge() handles sets merge (merge)", () => { assertEquals( deepMerge({ set: new Set(["foo"]), @@ -299,7 +299,7 @@ Deno.test("deepMerge: sets merge (merge)", () => { ); }); -Deno.test("deepMerge: nested replace", () => { +Deno.test("deepMerge() handles nested replace", () => { assertEquals( deepMerge( { @@ -332,7 +332,7 @@ Deno.test("deepMerge: nested replace", () => { ); }); -Deno.test("deepMerge: complex test", () => { +Deno.test("deepMerge() handles complex test", () => { assertEquals( deepMerge({ foo: { @@ -371,7 +371,7 @@ Deno.test("deepMerge: complex test", () => { ); }); -Deno.test("deepMerge: handle circular references", () => { +Deno.test("deepMerge() handles circular references", () => { const expected = { foo: true } as { foo: boolean; bar: unknown }; expected.bar = expected; assertEquals(deepMerge({}, expected), expected); @@ -395,7 +395,7 @@ Deno.test("deepMerge: handle circular references", () => { assertStrictEquals(result.foo.b.c.d, result.foo.b.c.d.foo.b.c.d); }); -Deno.test("deepMerge: target object is not modified", () => { +Deno.test("deepMerge() handles target object is not modified", () => { const record = { foo: { bar: true, diff --git a/collections/distinct_by_test.ts b/collections/distinct_by_test.ts index cb9ec5de4937..a99ea6764e39 100644 --- a/collections/distinct_by_test.ts +++ b/collections/distinct_by_test.ts @@ -14,7 +14,7 @@ function distinctByTest( } Deno.test({ - name: "[collections/distinctBy] identities on empty array", + name: "distinctBy() handles identities on empty array", fn() { distinctByTest( [], @@ -25,7 +25,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/distinctBy] gets head on noop selector", + name: "distinctBy() gets head on noop selector", fn() { distinctByTest( [25, "asdf", true], @@ -36,8 +36,7 @@ Deno.test({ }); Deno.test({ - name: - "[collections/distinctBy] removes duplicates and preserves order on identity", + name: "distinctBy() removes duplicates and preserves order on identity", fn() { distinctByTest( [true, "asdf", 4, "asdf", true], @@ -53,7 +52,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/distinctBy] does not check for deep equality on identity", + name: "distinctBy() does not check for deep equality on identity", fn() { const objects = [{ foo: "bar" }, { foo: "bar" }]; distinctByTest( @@ -93,8 +92,7 @@ Deno.test({ }); Deno.test({ - name: - "[collections/distinctBy] distincts by selected value and preserves order", + name: "distinctBy() handles distincts by selected value and preserves order", fn() { const kim = { name: "Kim", age: 22 }; const arthur = { name: "Arthur", age: 22 }; diff --git a/collections/distinct_test.ts b/collections/distinct_test.ts index 7c457b40d330..0fd769ae802a 100644 --- a/collections/distinct_test.ts +++ b/collections/distinct_test.ts @@ -13,14 +13,14 @@ function distinctTest( } Deno.test({ - name: "[collections/distinct] identities on empty array", + name: "distinct() handles identities on empty array", fn() { distinctTest([], []); }, }); Deno.test({ - name: "[collections/distinct] removes duplicates and preserves order", + name: "distinct() removes duplicates and preserves order", fn() { distinctTest( [true, "asdf", 4, "asdf", true], @@ -38,7 +38,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/distinct] does not check for deep equality", + name: "distinct() does not check for deep equality", fn() { const objects = [{ foo: "bar" }, { foo: "bar" }]; distinctTest(objects, objects); diff --git a/collections/drop_last_while_test.ts b/collections/drop_last_while_test.ts index f46e11044cdf..16209b988aab 100644 --- a/collections/drop_last_while_test.ts +++ b/collections/drop_last_while_test.ts @@ -2,7 +2,7 @@ import { dropLastWhile } from "./drop_last_while.ts"; import { assertEquals } from "../assert/mod.ts"; -Deno.test("[collections/dropLastWhile] Num array", () => { +Deno.test("dropLastWhile() handles num array", () => { const values = [20, 33, 44]; const actual = dropLastWhile(values, (i) => i > 30); @@ -10,7 +10,7 @@ Deno.test("[collections/dropLastWhile] Num array", () => { assertEquals(actual, [20]); }); -Deno.test("[collections/dropLastWhile] No mutation", () => { +Deno.test("dropLastWhile() handles no mutation", () => { const array = [1, 2, 3, 4, 5, 6]; const actual = dropLastWhile(array, (i) => i > 4); @@ -19,7 +19,7 @@ Deno.test("[collections/dropLastWhile] No mutation", () => { assertEquals(array, [1, 2, 3, 4, 5, 6]); }); -Deno.test("[collections/dropLastWhile] Negatives", () => { +Deno.test("dropLastWhile() handles negatives", () => { const array = [-1, -2, -3, -4, -5, -6]; const actual = dropLastWhile(array, (i) => i < -4); @@ -27,7 +27,7 @@ Deno.test("[collections/dropLastWhile] Negatives", () => { assertEquals(actual, [-1, -2, -3, -4]); }); -Deno.test("[collections/dropLastWhile] Empty input returns empty array", () => { +Deno.test("dropLastWhile() handles empty input returns empty array", () => { const array: number[] = []; const actual = dropLastWhile(array, (i) => i > 4); @@ -35,7 +35,7 @@ Deno.test("[collections/dropLastWhile] Empty input returns empty array", () => { assertEquals(actual, []); }); -Deno.test("[collections/dropLastWhile] Returns same array when the last element doesn't get dropped", () => { +Deno.test("dropLastWhile() returns same array when the last element doesn't get dropped", () => { const array = [40, 30, 20]; const actual = dropLastWhile(array, (i) => i > 40); @@ -43,7 +43,7 @@ Deno.test("[collections/dropLastWhile] Returns same array when the last element assertEquals(actual, [40, 30, 20]); }); -Deno.test("[collections/dropLastWhile] Returns empty array when all elements get dropped", () => { +Deno.test("dropLastWhile() returns empty array when all elements get dropped", () => { const array = [20, 30, 20]; const actual = dropLastWhile(array, (i) => i < 40); diff --git a/collections/drop_while_test.ts b/collections/drop_while_test.ts index 243c89f9b984..c2f7863addb0 100644 --- a/collections/drop_while_test.ts +++ b/collections/drop_while_test.ts @@ -3,28 +3,28 @@ import { assertEquals } from "../assert/mod.ts"; import { dropWhile } from "./drop_while.ts"; -Deno.test("[collections/dropWhile] Array", () => { +Deno.test("dropWhile() handles Array", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = dropWhile(arr, (i) => i !== 2); assertEquals(actual, [2, 3, 4, 5, 6]); }); -Deno.test("[collections/dropWhile] Add two to each num in predicate", () => { +Deno.test("dropWhile() adds two to each num in predicate", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = dropWhile(arr, (i) => i + 2 !== 6); assertEquals(actual, [4, 5, 6]); }); -Deno.test("[collections/dropWhile] Negatives", () => { +Deno.test("dropWhile() handles negatives", () => { const arr = [-5, -6]; const actual = dropWhile(arr, (i) => i < -4); assertEquals(actual, []); }); -Deno.test("[collections/dropWhile] No mutation", () => { +Deno.test("dropWhile() handles no mutation", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = dropWhile(arr, (i) => i !== 4); @@ -32,7 +32,7 @@ Deno.test("[collections/dropWhile] No mutation", () => { assertEquals(arr, [1, 2, 3, 4, 5, 6]); }); -Deno.test("[collections/dropWhile] Empty input array returns empty array", () => { +Deno.test("dropWhile() handles empty input array returns empty array", () => { const arr: number[] = []; const actual = dropWhile(arr, (i) => i > 4); @@ -40,7 +40,7 @@ Deno.test("[collections/dropWhile] Empty input array returns empty array", () => assertEquals(actual, []); }); -Deno.test("[collections/dropWhile] Returns empty array when the last element doesn't match the predicate", () => { +Deno.test("dropWhile() returns empty array when the last element doesn't match the predicate", () => { const arr = [1, 2, 3, 4]; const actual = dropWhile(arr, (i) => i !== 4); @@ -48,7 +48,7 @@ Deno.test("[collections/dropWhile] Returns empty array when the last element doe assertEquals(actual, [4]); }); -Deno.test("[collections/dropWhile] Returns the same array when all elements match the predicate", () => { +Deno.test("dropWhile() returns the same array when all elements match the predicate", () => { const arr = [1, 2, 3, 4]; const actual = dropWhile(arr, (i) => i !== 400); diff --git a/collections/filter_entries_test.ts b/collections/filter_entries_test.ts index 9ee4bc017706..08d391ada4fe 100644 --- a/collections/filter_entries_test.ts +++ b/collections/filter_entries_test.ts @@ -13,7 +13,7 @@ function filterEntriesTest( } Deno.test({ - name: "[collections/filterEntries] no mutation", + name: "filterEntries() handles no mutation", fn() { const object = { a: 5, b: true }; filterEntries(object, ([key]) => key !== "a"); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterEntries] empty input", + name: "filterEntries() handles empty input", fn() { filterEntriesTest( [{}, () => true], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterEntries] identity", + name: "filterEntries() handles identity", fn() { filterEntriesTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterEntries] clean object", + name: "filterEntries() handles clean object", fn() { filterEntriesTest( [ @@ -67,7 +67,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterEntries] filters", + name: "filterEntries() handles filters", fn() { filterEntriesTest( [ diff --git a/collections/filter_keys_test.ts b/collections/filter_keys_test.ts index 9b4ee7c434d7..cd43fda35b9e 100644 --- a/collections/filter_keys_test.ts +++ b/collections/filter_keys_test.ts @@ -13,7 +13,7 @@ function filterKeysTest( } Deno.test({ - name: "[collections/filterKeys] no mutation", + name: "filterKeys() handles no mutation", fn() { const object = { a: 5, b: true }; filterKeys(object, (key) => key !== "a"); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterKeys] empty input", + name: "filterKeys() handles empty input", fn() { filterKeysTest( [{}, () => true], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterKeys] identity", + name: "filterKeys() handles identity", fn() { filterKeysTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterKeys] filters", + name: "filterKeys() handles filters", fn() { filterKeysTest( [ diff --git a/collections/filter_values_test.ts b/collections/filter_values_test.ts index 2168bdc7abc5..34e518d65933 100644 --- a/collections/filter_values_test.ts +++ b/collections/filter_values_test.ts @@ -13,7 +13,7 @@ function filterValuesTest( } Deno.test({ - name: "[collections/filterValues] no mutation", + name: "filterValues() handles no mutation", fn() { const object = { a: 5, b: true }; filterValues(object, (it) => it !== 5); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterValues] empty input", + name: "filterValues() handles empty input", fn() { filterValuesTest( [{}, () => true], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterValues] identity", + name: "filterValues() handles identity", fn() { filterValuesTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/filterValues] filters", + name: "filterValues() handles filters", fn() { filterValuesTest( [ diff --git a/collections/find_single_test.ts b/collections/find_single_test.ts index ed3a1faaa47f..ab492bd2ea35 100644 --- a/collections/find_single_test.ts +++ b/collections/find_single_test.ts @@ -13,7 +13,7 @@ function findSingleTest( } Deno.test({ - name: "[collections/findSingle] no mutation", + name: "findSingle() handles no mutation", fn() { const array = [1, 2, 3]; findSingle(array, (it) => it % 2 === 0); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/findSingle] empty input", + name: "findSingle() handles empty input", fn() { findSingleTest( [[], (_) => true], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/findSingle] only one element", + name: "findSingle() handles only one element", fn() { findSingleTest( [[42], (_it) => true], @@ -55,7 +55,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/findSingle] no matches", + name: "findSingle() handles no matches", fn() { findSingleTest( [[9, 11, 13], (it) => it % 2 === 0], @@ -73,7 +73,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/findSingle] only match", + name: "findSingle() handles only match", fn() { findSingleTest( [[9, 12, 13], (it) => it % 2 === 0], @@ -91,7 +91,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/findSingle] multiple matches", + name: "findSingle() handles multiple matches", fn() { findSingleTest( [[9, 12, 13, 14], (it) => it % 2 === 0], diff --git a/collections/first_not_nullish_of_test.ts b/collections/first_not_nullish_of_test.ts index 0efa23efe5cc..b65b31930918 100644 --- a/collections/first_not_nullish_of_test.ts +++ b/collections/first_not_nullish_of_test.ts @@ -13,7 +13,7 @@ function firstNotNullishOfTest( } Deno.test({ - name: "[collections/firstNotNullishOf] no mutation", + name: "firstNotNullishOf() handles no mutation", fn() { const array = [1, 2, 3, 4]; firstNotNullishOf(array, (it) => it * 2); @@ -23,42 +23,42 @@ Deno.test({ }); Deno.test({ - name: "[collections/firstNotNullishOf] empty input", + name: "firstNotNullishOf() handles empty input", fn() { firstNotNullishOfTest([[], (it) => it], undefined); }, }); Deno.test({ - name: "[collections/firstNotNullishOf] all items nullish", + name: "firstNotNullishOf() handles all items nullish", fn() { firstNotNullishOfTest([[undefined, null], (it) => it], undefined); }, }); Deno.test({ - name: "[collections/firstNotNullishOf] identity", + name: "firstNotNullishOf() handles identity", fn() { firstNotNullishOfTest([[[], 1, 3], (it) => it], []); }, }); Deno.test({ - name: "[collections/firstNotNullishOf] array of array", + name: "firstNotNullishOf() handles array of array", fn() { firstNotNullishOfTest([[[, 0], [null], ["Kim"]], (it) => it[0]], "Kim"); }, }); Deno.test({ - name: "[collections/firstNotNullishOf] falsy values", + name: "firstNotNullishOf() handles falsy values", fn() { firstNotNullishOfTest([[undefined, false, null], (it) => it], false); }, }); Deno.test({ - name: "[collections/firstNotNullishOf] mappers without nullish values", + name: "firstNotNullishOf() handles mappers without nullish values", fn() { firstNotNullishOfTest( [["Anna", "Kim", "Hans"], (it) => it.charAt(0)], @@ -69,7 +69,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/firstNotNullishOf] mappers with nullish values", + name: "firstNotNullishOf() handles mappers with nullish values", fn() { firstNotNullishOfTest( [ diff --git a/collections/group_by_test.ts b/collections/group_by_test.ts index 7720c488319a..62368249f843 100644 --- a/collections/group_by_test.ts +++ b/collections/group_by_test.ts @@ -13,7 +13,7 @@ function groupByTest( } Deno.test({ - name: "[collections/groupBy] no mutation", + name: "groupBy() handles no mutation", fn() { const arrayA = [1.1, 4.2, 4.5]; groupBy(arrayA, () => "test"); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/groupBy] empty input", + name: "groupBy() handles empty input", fn() { groupByTest( [[], () => "a"], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/groupBy] constant key", + name: "groupBy() handles constant key", fn() { groupByTest( [[1, 3, 5, 6], () => "a"], @@ -42,7 +42,7 @@ Deno.test({ }, }); Deno.test({ - name: "[collections/groupBy] non-string key", + name: "groupBy() handles non-string key", fn() { groupByTest( [ @@ -64,7 +64,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/groupBy] empty key", + name: "groupBy() handles empty key", fn() { groupByTest( [ @@ -80,7 +80,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/groupBy] groups", + name: "groupBy() handles groups", fn() { groupByTest( [ @@ -108,7 +108,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/groupBy] callback index", + name: "groupBy() handles callback index", fn() { const actual = groupBy( ["a", "b", "c", "d"], @@ -122,7 +122,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/groupBy] iterable input", + name: "groupBy() handles iterable input", fn() { function* count(): Generator { for (let i = 0; i < 5; i += 1) yield i; diff --git a/collections/includes_value_test.ts b/collections/includes_value_test.ts index c27a38df70c5..760d64ff89a7 100644 --- a/collections/includes_value_test.ts +++ b/collections/includes_value_test.ts @@ -2,7 +2,7 @@ import { includesValue } from "./includes_value.ts"; import { assert, assertEquals } from "../assert/mod.ts"; -Deno.test("[collections/includesValue] Example", () => { +Deno.test("includesValue() handles example", () => { const input = { first: 33, second: 34, @@ -11,7 +11,7 @@ Deno.test("[collections/includesValue] Example", () => { assert(actual); }); -Deno.test("[collections/includesValue] No mutation", () => { +Deno.test("includesValue() handles no mutation", () => { const input = { first: 33, second: 34, @@ -25,7 +25,7 @@ Deno.test("[collections/includesValue] No mutation", () => { }); }); -Deno.test("[collections/includesValue] Empty input returns false", () => { +Deno.test("includesValue() handles empty input returns false", () => { const input = {}; const actual = includesValue(input, 44); @@ -33,7 +33,7 @@ Deno.test("[collections/includesValue] Empty input returns false", () => { assert(!actual); }); -Deno.test("[collections/includesValue] Returns false when it doesn't include the value", () => { +Deno.test("includesValue() returns false when it doesn't include the value", () => { const input = { first: 33, second: 34, @@ -44,7 +44,7 @@ Deno.test("[collections/includesValue] Returns false when it doesn't include the assert(!actual); }); -Deno.test("[collections/includesValue] Non-enumerable properties", () => { +Deno.test("includesValue() handles non-enumerable properties", () => { // FAIL is expected, TODO: Figure out how to make it work on const input = {}; @@ -72,7 +72,7 @@ Deno.test("[collections/includesValue] Non-enumerable properties", () => { assert(!actual3); }); -Deno.test("[collections/includesValue] Non-primitive values", () => { +Deno.test("includesValue() handles non-primitive values", () => { const input = { first: {}, }; @@ -82,7 +82,7 @@ Deno.test("[collections/includesValue] Non-primitive values", () => { assert(!actual); }); -Deno.test("[collections/includesValue] Same behaviour as naive impl", () => { +Deno.test("includesValue() handles same behaviour as naive impl", () => { const input = { first: 42, }; @@ -93,7 +93,7 @@ Deno.test("[collections/includesValue] Same behaviour as naive impl", () => { assertEquals(includesValueResult, naiveImplResult); }); -Deno.test("[collections/includesValue] Works with NaN", () => { +Deno.test("includesValue() handles NaN value", () => { const input = { first: NaN, }; @@ -103,7 +103,7 @@ Deno.test("[collections/includesValue] Works with NaN", () => { assert(actual); }); -Deno.test("[collections/includesValue] prevent enumerable prototype check", () => { +Deno.test("includesValue() prevents enumerable prototype check", () => { class Foo {} // @ts-ignore: for test Foo.prototype.a = "hello"; diff --git a/collections/intersect_test.ts b/collections/intersect_test.ts index 1ee9624dc894..88cd89f896c2 100644 --- a/collections/intersect_test.ts +++ b/collections/intersect_test.ts @@ -13,7 +13,7 @@ function intersectTest( } Deno.test({ - name: "[collections/intersect] no mutation", + name: "intersect() handles no mutation", fn() { const arrayA = [1, 2, 3]; const arrayB = [3, 4, 5]; @@ -25,21 +25,21 @@ Deno.test({ }); Deno.test({ - name: "[collections/intersect] empty input", + name: "intersect() handles empty input", fn() { intersectTest([], []); }, }); Deno.test({ - name: "[collections/intersect] empty arrays", + name: "intersect() handles empty arrays", fn() { intersectTest([[], []], []); }, }); Deno.test({ - name: "[collections/intersect] one side empty", + name: "intersect() handles one side empty", fn() { intersectTest([[], ["a", "b", "c"]], []); intersectTest([["a", "b", "c"], []], []); @@ -47,14 +47,14 @@ Deno.test({ }); Deno.test({ - name: "[collections/intersect] empty result", + name: "intersect() handles empty result", fn() { intersectTest([["a", "b", "c"], ["d", "e", "f"]], []); }, }); Deno.test({ - name: "[collections/intersect] one or more items in intersection", + name: "intersect() handles one or more items in intersection", fn() { intersectTest([["a", "b"], ["b", "c"]], ["b"]); intersectTest([["a", "b", "c", "d"], ["c", "d", "e", "f"]], ["c", "d"]); @@ -62,7 +62,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/intersect] duplicates", + name: "intersect() handles duplicates", fn() { intersectTest([["a", "b", "c", "b"], ["b", "c"]], ["b", "c"]); intersectTest([["a", "b"], ["b", "b", "c", "c"]], ["b"]); @@ -70,7 +70,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/intersect] more than two inputs", + name: "intersect() handles more than two inputs", fn() { intersectTest( [ @@ -101,7 +101,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/intersect] objects", + name: "intersect() handles objects", fn() { intersectTest>([ [{ foo: "bar" }, { bar: "baz" }], @@ -121,7 +121,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/intersect] functions", + name: "intersect() handles functions", fn() { intersectTest([ [() => {}, () => null], diff --git a/collections/join_to_string_test.ts b/collections/join_to_string_test.ts index c8549623566e..490087db31e8 100644 --- a/collections/join_to_string_test.ts +++ b/collections/join_to_string_test.ts @@ -4,7 +4,7 @@ import { assertEquals } from "../assert/mod.ts"; import { joinToString } from "./join_to_string.ts"; Deno.test({ - name: "[collections/joinToString] no mutation", + name: "joinToString() handles no mutation", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -22,7 +22,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] identity", + name: "joinToString() handles identity", fn() { const arr = ["Kim", "Anna", "Tim"]; @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] normal mapppers", + name: "joinToString() handles normal mapppers", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -47,7 +47,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] separator", + name: "joinToString() handles separator", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -61,7 +61,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] prefix", + name: "joinToString() handles prefix", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -77,7 +77,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] suffix", + name: "joinToString() handles suffix", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -93,7 +93,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] limit", + name: "joinToString() handles limit", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -109,7 +109,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] truncated", + name: "joinToString() handles truncated", fn() { const arr = [ { name: "Kim", age: 22 }, @@ -126,7 +126,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/joinToString] all options", + name: "joinToString() handles all options", fn() { const arr = [ { name: "Kim", age: 22 }, diff --git a/collections/map_entries_test.ts b/collections/map_entries_test.ts index 18a0e20e42b8..d8b97b3a75ce 100644 --- a/collections/map_entries_test.ts +++ b/collections/map_entries_test.ts @@ -13,7 +13,7 @@ function mapEntriesTest( } Deno.test({ - name: "[collections/mapEntries] no mutation", + name: "mapEntries() handles no mutation", fn() { const object = { a: 5, b: true }; mapEntries(object, ([key, value]) => [`${key}a`, value]); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] empty input", + name: "mapEntries() handles empty input", fn() { mapEntriesTest( [{}, (it) => it], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] identity", + name: "mapEntries() handles identity", fn() { mapEntriesTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] to constant entry", + name: "mapEntries() handles to constant entry", fn() { mapEntriesTest( [ @@ -67,7 +67,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] overlapping keys", + name: "mapEntries() handles overlapping keys", fn() { mapEntriesTest( [ @@ -104,7 +104,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] normal mappers", + name: "mapEntries() handles normal mappers", fn() { mapEntriesTest( [ diff --git a/collections/map_keys_test.ts b/collections/map_keys_test.ts index 8fcdffa48314..566b6aa85ac3 100644 --- a/collections/map_keys_test.ts +++ b/collections/map_keys_test.ts @@ -13,7 +13,7 @@ function mapKeysTest( } Deno.test({ - name: "[collections/mapKeys] no mutation", + name: "mapKeys() handles no mutation", fn() { const object = { a: 5, b: true }; mapKeys(object, (it) => `${it}a`); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapKeys] empty input", + name: "mapKeys() handles empty input", fn() { mapKeysTest( [{}, (it) => it], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapKeys] identity", + name: "mapKeys() handles identity", fn() { mapKeysTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapKeys] to constant key", + name: "mapKeys() handles to constant key", fn() { mapKeysTest( [ @@ -67,7 +67,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapKeys] overlapping keys", + name: "mapKeys() handles overlapping keys", fn() { mapKeysTest( [ @@ -104,7 +104,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapKeys] empty key", + name: "mapKeys() handles empty key", fn() { mapKeysTest( [ @@ -126,7 +126,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapKeys] normal mappers", + name: "mapKeys() handles normal mappers", fn() { mapKeysTest( [ diff --git a/collections/map_not_nullish_test.ts b/collections/map_not_nullish_test.ts index 2db299cdf1d3..4db980757008 100644 --- a/collections/map_not_nullish_test.ts +++ b/collections/map_not_nullish_test.ts @@ -13,7 +13,7 @@ function mapNotNullishTest( } Deno.test({ - name: "[collections/mapNotNullish] no mutation", + name: "mapNotNullish() handles no mutation", fn() { const array = [1, 2, 3, 4]; mapNotNullish(array, (it) => it * 2); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapNotNullish] empty input", + name: "mapNotNullish() handles empty input", fn() { mapNotNullishTest( [[], (it) => it], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapNotNullish] identity", + name: "mapNotNullish() handles identity", fn() { mapNotNullishTest( [ @@ -46,7 +46,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapNotNullish] mappers without nullish values", + name: "mapNotNullish() handles mappers without nullish values", fn() { mapNotNullishTest( [ @@ -66,7 +66,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapNotNullish] mappers with nullish values", + name: "mapNotNullish() handles mappers with nullish values", fn() { mapNotNullishTest( [ diff --git a/collections/map_values_test.ts b/collections/map_values_test.ts index 1f714e6aafb6..f1f468d6effb 100644 --- a/collections/map_values_test.ts +++ b/collections/map_values_test.ts @@ -13,7 +13,7 @@ function mapValuesTest( } Deno.test({ - name: "[collections/mapValues] no mutation", + name: "mapValues() handles no mutation", fn() { const object = { a: 5, b: true }; mapValues(object, (it) => it ?? "nothing"); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapValues] empty input", + name: "mapValues() handles empty input", fn() { mapValuesTest( [{}, (it) => it], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapValues] identity", + name: "mapValues() handles identity", fn() { mapValuesTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapValues] falsy values", + name: "mapValues() handles falsy values", fn() { mapValuesTest( [ @@ -77,7 +77,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapValues] normal mappers", + name: "mapValues() handles normal mappers", fn() { mapValuesTest( [ @@ -111,7 +111,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapValues] preserves key type (Record)", + name: "mapValues() preserves key type (Record)", fn() { type Variants = "a" | "b"; const input: Record = { a: "a", b: "b" }; @@ -126,7 +126,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapValues] preserves key type (Partial Record)", + name: "mapValues() preserves key type (Partial Record)", fn() { type Variants = "a" | "b"; const input: Partial> = { a: "a" }; diff --git a/collections/max_by_test.ts b/collections/max_by_test.ts index 4b3ef6daa4f1..ada9a03b7e56 100644 --- a/collections/max_by_test.ts +++ b/collections/max_by_test.ts @@ -3,7 +3,7 @@ import { assertEquals } from "../assert/mod.ts"; import { maxBy } from "./max_by.ts"; -Deno.test("[collections/maxBy] of array of input", () => { +Deno.test("maxBy() handles array input", () => { const input = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -15,7 +15,7 @@ Deno.test("[collections/maxBy] of array of input", () => { assertEquals(max, { name: "John", age: 42 }); }); -Deno.test("[collections/maxBy] of array of input with mutation", () => { +Deno.test("maxBy() handles array input with mutation", () => { const input = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -27,7 +27,7 @@ Deno.test("[collections/maxBy] of array of input with mutation", () => { assertEquals(max, { name: "John", age: 42 }); }); -Deno.test("[collections/maxBy] of array of input with multiple max", () => { +Deno.test("maxBy() handles array input with multiple max", () => { const input = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -40,7 +40,7 @@ Deno.test("[collections/maxBy] of array of input with multiple max", () => { assertEquals(max, { name: "John", age: 42 }); }); -Deno.test("[collections/maxBy] of array of positive numbers", () => { +Deno.test("maxBy() handles array of positive numbers", () => { const input = [2, 3, 5]; const max = maxBy(input, (i) => i); @@ -48,7 +48,7 @@ Deno.test("[collections/maxBy] of array of positive numbers", () => { assertEquals(max, 5); }); -Deno.test("[collections/maxBy] of array of negative numbers", () => { +Deno.test("maxBy() handles array of negative numbers", () => { const input = [-2, -3, -5]; const max = maxBy(input, (i: number) => i); @@ -56,7 +56,7 @@ Deno.test("[collections/maxBy] of array of negative numbers", () => { assertEquals(max, -2); }); -Deno.test("[collections/maxBy] of array of strings", () => { +Deno.test("maxBy() handles array of strings", () => { const input = ["Kyle", "John", "Anna"]; const max = maxBy(input, (i: string) => i); @@ -64,7 +64,7 @@ Deno.test("[collections/maxBy] of array of strings", () => { assertEquals(max, "Kyle"); }); -Deno.test("[collections/maxBy] of empty array", () => { +Deno.test("maxBy() handles of empty array", () => { const input: number[] = []; const max = maxBy(input, (i) => i); @@ -72,7 +72,7 @@ Deno.test("[collections/maxBy] of empty array", () => { assertEquals(max, undefined); }); -Deno.test("[collections/maxBy] of array of numbers with multiple max", () => { +Deno.test("maxBy() handles array of numbers with multiple max", () => { const input = [2, 3, 5, 5]; const max = maxBy(input, (i) => i); @@ -80,7 +80,7 @@ Deno.test("[collections/maxBy] of array of numbers with multiple max", () => { assertEquals(max, 5); }); -Deno.test("[collections/maxBy] of array of numbers with infinity", () => { +Deno.test("maxBy() handles array of numbers with infinity", () => { const input = [2, 3, 5, Infinity]; const max = maxBy(input, (i) => i); @@ -88,7 +88,7 @@ Deno.test("[collections/maxBy] of array of numbers with infinity", () => { assertEquals(max, Infinity); }); -Deno.test("[collections/maxBy] of array of numbers with NaN", () => { +Deno.test("maxBy() handles array of numbers with NaN", () => { const input = [2, 3, 5, NaN]; const max = maxBy(input, (i) => i); @@ -96,7 +96,7 @@ Deno.test("[collections/maxBy] of array of numbers with NaN", () => { assertEquals(max, 5); }); -Deno.test("[collections/maxBy] no mutation", () => { +Deno.test("maxBy() handles no mutation", () => { const input = [2, 3, 5]; maxBy(input, (i) => i); @@ -104,7 +104,7 @@ Deno.test("[collections/maxBy] no mutation", () => { assertEquals(input, [2, 3, 5]); }); -Deno.test("[collections/maxBy] empty input", () => { +Deno.test("maxBy() handles empty input", () => { const emptyArray: Array<{ age: number }> = []; const max = maxBy(emptyArray, (it) => it.age); @@ -112,7 +112,7 @@ Deno.test("[collections/maxBy] empty input", () => { }); Deno.test({ - name: "[collections/sortBy] bigint", + name: "maxBy() handles bigint", fn() { const input = [ "9007199254740999", @@ -125,7 +125,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] date", + name: "maxBy() handles date", fn() { const input = [ "February 1, 2022", diff --git a/collections/max_of_test.ts b/collections/max_of_test.ts index 8334e846bc0d..c9909223966b 100644 --- a/collections/max_of_test.ts +++ b/collections/max_of_test.ts @@ -2,42 +2,42 @@ import { maxOf } from "./max_of.ts"; import { assertEquals } from "../assert/mod.ts"; -Deno.test("[collections/maxOf] Regular max", () => { +Deno.test("maxOf() handles regular max", () => { const array = [5, 18, 35, 120]; const actual = maxOf(array, (i) => i); assertEquals(actual, 120); }); -Deno.test("[collections/maxOf] Mixed negatives and positives numbers", () => { +Deno.test("maxOf() handles mixed negatives and positives numbers", () => { const array = [-32, -18, 140, 36]; const actual = maxOf(array, (i) => i); assertEquals(actual, 140); }); -Deno.test("[collections/maxOf] Negatives numbers", () => { +Deno.test("maxOf() handles negatives numbers", () => { const array = [-32, -18, -140, -36]; const actual = maxOf(array, (i) => i); assertEquals(actual, -18); }); -Deno.test("[collections/maxOf] BigInt regular max", () => { +Deno.test("maxOf() handles BigInt regular max", () => { const array = [BigInt(5), BigInt(18), BigInt(35), BigInt(120)]; const actual = maxOf(array, (i) => i); assertEquals(actual, BigInt(120)); }); -Deno.test("[collections/maxOf] BigInt negatives numbers", () => { +Deno.test("maxOf() handles BigInt negatives numbers", () => { const array = [BigInt(-32), BigInt(-18), BigInt(-140), BigInt(-36)]; const actual = maxOf(array, (i) => i); assertEquals(actual, BigInt(-18)); }); -Deno.test("[collection/maxOf] On object properties", () => { +Deno.test("maxOf() handles object properties", () => { const object = [ { name: "mustard", count: 2 }, { name: "soy", count: 4 }, @@ -48,7 +48,7 @@ Deno.test("[collection/maxOf] On object properties", () => { assertEquals(actual, 32); }); -Deno.test("[collection/maxOf] On mixed object properties", () => { +Deno.test("maxOf() handles mixed object properties", () => { const object = [ { name: "mustard", count: -2 }, { name: "soy", count: 4 }, @@ -59,7 +59,7 @@ Deno.test("[collection/maxOf] On mixed object properties", () => { assertEquals(actual, 4); }); -Deno.test("[collections/maxOf] No mutation", () => { +Deno.test("maxOf() handles no mutation", () => { const array = [1, 2, 3, 4]; maxOf(array, (i) => i + 2); @@ -67,14 +67,14 @@ Deno.test("[collections/maxOf] No mutation", () => { assertEquals(array, [1, 2, 3, 4]); }); -Deno.test("[collections/maxOf] Empty array results in undefined", () => { +Deno.test("maxOf() handles empty array results in undefined", () => { const array: number[] = []; const actual = maxOf(array, (i) => i); assertEquals(actual, undefined); }); -Deno.test("[collections/maxOf] NaN and Infinity", () => { +Deno.test("maxOf() handles NaN and Infinity", () => { const array = [ 1, 2, @@ -93,7 +93,7 @@ Deno.test("[collections/maxOf] NaN and Infinity", () => { assertEquals(actual, NaN); }); -Deno.test("[collections/maxOf] Infinity", () => { +Deno.test("maxOf() handles infinity", () => { const array = [1, 2, Infinity, 3, 4, 5, 6, 7, 8]; const actual = maxOf(array, (i) => i); diff --git a/collections/max_with_test.ts b/collections/max_with_test.ts index 05380ed23b10..cc1b4b467a77 100644 --- a/collections/max_with_test.ts +++ b/collections/max_with_test.ts @@ -13,7 +13,7 @@ function maxWithTest( } Deno.test({ - name: "[collections/maxWith] no mutation", + name: "maxWith() handles no mutation", fn() { const input = [[1, 3], [6, 1, 3], [4]]; maxWith(input, (a, b) => a.length - b.length); @@ -23,14 +23,14 @@ Deno.test({ }); Deno.test({ - name: "[collections/maxWith] empty input", + name: "maxWith() handles empty input", fn() { maxWithTest([[], (a, b) => a.length - b.length], undefined); }, }); Deno.test({ - name: "[collections/maxWith] array of arrays", + name: "maxWith() handles array of arrays", fn() { maxWithTest([[[1, 3], [6, 1, 3], [4]], (a, b) => a.length - b.length], [ 6, @@ -41,7 +41,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/maxWith] array of strings", + name: "maxWith() handles array of strings", fn() { maxWithTest( [["Kim", "Anna", "Arthur"], (a, b) => a.length - b.length], @@ -51,7 +51,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/maxWith] array of objects", + name: "maxWith() handles array of objects", fn() { maxWithTest( [ @@ -68,7 +68,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/maxWith] duplicates", + name: "maxWith() handles duplicates", fn() { maxWithTest( [["John", "Arthur", "Arthur"], (a, b) => a.length - b.length], @@ -78,7 +78,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/maxWith] array containing undefined", + name: "maxWith() handles array containing undefined", fn() { maxWithTest( [ diff --git a/collections/min_by_test.ts b/collections/min_by_test.ts index 57ed17f8c9e3..1de9357c3a63 100644 --- a/collections/min_by_test.ts +++ b/collections/min_by_test.ts @@ -3,7 +3,7 @@ import { assertEquals } from "../assert/mod.ts"; import { minBy } from "./min_by.ts"; -Deno.test("[collections/minBy] of array of input", () => { +Deno.test("minBy() handles array input", () => { const input = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -15,7 +15,7 @@ Deno.test("[collections/minBy] of array of input", () => { assertEquals(min, { name: "Anna", age: 23 }); }); -Deno.test("[collections/minBy] of array of input with mutation", () => { +Deno.test("minBy() handles array input with mutation", () => { const input = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -27,7 +27,7 @@ Deno.test("[collections/minBy] of array of input with mutation", () => { assertEquals(min, { name: "Anna", age: 23 }); }); -Deno.test("[collections/minBy] of array of input with multiple min", () => { +Deno.test("minBy() handles array input with multiple min", () => { const input = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -40,7 +40,7 @@ Deno.test("[collections/minBy] of array of input with multiple min", () => { assertEquals(min, { name: "Anna", age: 23 }); }); -Deno.test("[collections/minBy] of array of positive numbers", () => { +Deno.test("minBy() handles array of positive numbers", () => { const input = [2, 3, 5]; const min = minBy(input, (i) => i); @@ -48,7 +48,7 @@ Deno.test("[collections/minBy] of array of positive numbers", () => { assertEquals(min, 2); }); -Deno.test("[collections/minBy] of array of negative numbers", () => { +Deno.test("minBy() handles array of negative numbers", () => { const input = [-2, -3, -5]; const min = minBy(input, (i) => i); @@ -56,7 +56,7 @@ Deno.test("[collections/minBy] of array of negative numbers", () => { assertEquals(min, -5); }); -Deno.test("[collections/minBy] of array of strings", () => { +Deno.test("minBy() handles array of strings", () => { const input = ["Kyle", "John", "Anna"]; const min = minBy(input, (i: string) => i); @@ -64,7 +64,7 @@ Deno.test("[collections/minBy] of array of strings", () => { assertEquals(min, "Anna"); }); -Deno.test("[collections/minBy] of empty array", () => { +Deno.test("minBy() handles of empty array", () => { const input: number[] = []; const min = minBy(input, (i) => i); @@ -72,7 +72,7 @@ Deno.test("[collections/minBy] of empty array", () => { assertEquals(min, undefined); }); -Deno.test("[collections/minBy] of array of numbers with multiple min", () => { +Deno.test("minBy() handles array of numbers with multiple min", () => { const input = [2, 3, 5, 5]; const min = minBy(input, (i) => i); @@ -80,7 +80,7 @@ Deno.test("[collections/minBy] of array of numbers with multiple min", () => { assertEquals(min, 2); }); -Deno.test("[collections/minBy] of array of numbers with infinity", () => { +Deno.test("minBy() handles array of numbers with infinity", () => { const input = [2, 3, 5, -Infinity]; const min = minBy(input, (i: number) => i); @@ -88,7 +88,7 @@ Deno.test("[collections/minBy] of array of numbers with infinity", () => { assertEquals(min, -Infinity); }); -Deno.test("[collections/minBy] of array of numbers with NaN", () => { +Deno.test("minBy() handles array of numbers with NaN", () => { const input = [2, 3, 5, NaN]; const min = minBy(input, (i) => i); @@ -96,7 +96,7 @@ Deno.test("[collections/minBy] of array of numbers with NaN", () => { assertEquals(min, 2); }); -Deno.test("[collections/minBy] no mutation", () => { +Deno.test("minBy() handles no mutation", () => { const input = [2, 3, 5, NaN]; minBy(input, (i: number) => i); @@ -104,7 +104,7 @@ Deno.test("[collections/minBy] no mutation", () => { assertEquals(input, [2, 3, 5, NaN]); }); -Deno.test("[collections/minBy] empty input", () => { +Deno.test("minBy() handles empty input", () => { const input: Array<{ age: number }> = []; const min = minBy(input, (i) => i.age); @@ -113,7 +113,7 @@ Deno.test("[collections/minBy] empty input", () => { }); Deno.test({ - name: "[collections/sortBy] bigint", + name: "minBy() handles bigint", fn() { const input = [ "9007199254740999", @@ -126,7 +126,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] date", + name: "minBy() handles date", fn() { const input = [ "February 1, 2022", diff --git a/collections/min_of_test.ts b/collections/min_of_test.ts index 1799e78bc76d..833263752278 100644 --- a/collections/min_of_test.ts +++ b/collections/min_of_test.ts @@ -2,42 +2,42 @@ import { minOf } from "./min_of.ts"; import { assertEquals } from "../assert/mod.ts"; -Deno.test("[collections/minOf] Regular min", () => { +Deno.test("minOf() handles regular min", () => { const array = [5, 18, 35, 120]; const actual = minOf(array, (i) => i); assertEquals(actual, 5); }); -Deno.test("[collections/minOf] Mixed negatives and positives numbers", () => { +Deno.test("minOf() handles mixed negatives and positives numbers", () => { const array = [-32, -18, 140, 36]; const actual = minOf(array, (i) => i); assertEquals(actual, -32); }); -Deno.test("[collections/minOf] Negatives numbers", () => { +Deno.test("minOf() handles negatives numbers", () => { const array = [-32, -18, -140, -36]; const actual = minOf(array, (i) => i); assertEquals(actual, -140); }); -Deno.test("[collections/minOf] BigInt regular min", () => { +Deno.test("minOf() handles BigInt regular min", () => { const array = [BigInt(5), BigInt(18), BigInt(35), BigInt(120)]; const actual = minOf(array, (i) => i); assertEquals(actual, BigInt(5)); }); -Deno.test("[collections/minOf] BigInt negatives numbers", () => { +Deno.test("minOf() handles BigInt negatives numbers", () => { const array = [BigInt(-32), BigInt(-18), BigInt(-140), BigInt(-36)]; const actual = minOf(array, (i) => i); assertEquals(actual, BigInt(-140)); }); -Deno.test("[collection/minOf] On object properties", () => { +Deno.test("minOf() handles object properties", () => { const object = [ { name: "mustard", count: 2 }, { name: "soy", count: 4 }, @@ -48,7 +48,7 @@ Deno.test("[collection/minOf] On object properties", () => { assertEquals(actual, 2); }); -Deno.test("[collection/minOf] On mixed object properties", () => { +Deno.test("minOf() handles mixed object properties", () => { const object = [ { name: "mustard", count: -2 }, { name: "soy", count: 4 }, @@ -59,7 +59,7 @@ Deno.test("[collection/minOf] On mixed object properties", () => { assertEquals(actual, -32); }); -Deno.test("[collections/minOf] No mutation", () => { +Deno.test("minOf() handles no mutation", () => { const array = [1, 2, 3, 4]; minOf(array, (i) => i + 2); @@ -67,14 +67,14 @@ Deno.test("[collections/minOf] No mutation", () => { assertEquals(array, [1, 2, 3, 4]); }); -Deno.test("[collections/minOf] Empty array results in undefined", () => { +Deno.test("minOf() handles empty array results in undefined", () => { const array: number[] = []; const actual = minOf(array, (i) => i); assertEquals(actual, undefined); }); -Deno.test("[collections/minOf] NaN and Infinity", () => { +Deno.test("minOf() handles NaN and Infinity", () => { const array = [ 1, 2, @@ -93,7 +93,7 @@ Deno.test("[collections/minOf] NaN and Infinity", () => { assertEquals(actual, NaN); }); -Deno.test("[collections/minOf] Minus infinity", () => { +Deno.test("minOf() handles minus infinity", () => { const array = [1, 2, -Infinity, 3, 4, 5, 6, 7, 8]; const actual = minOf(array, (i) => i); diff --git a/collections/min_with_test.ts b/collections/min_with_test.ts index cba24b92dbd2..2f6ecb6dfda9 100644 --- a/collections/min_with_test.ts +++ b/collections/min_with_test.ts @@ -13,7 +13,7 @@ function minWithTest( } Deno.test({ - name: "[collections/minWith] no mutation", + name: "minWith() handles no mutation", fn() { const input = [[1, 3], [6, 1, 3], [4]]; minWith(input, (a, b) => a.length - b.length); @@ -23,21 +23,21 @@ Deno.test({ }); Deno.test({ - name: "[collections/minWith] empty input", + name: "minWith() handles empty input", fn() { minWithTest([[], (a, b) => a.length - b.length], undefined); }, }); Deno.test({ - name: "[collections/minWith] array of arrays", + name: "minWith() handles array of arrays", fn() { minWithTest([[[1, 3], [6, 1, 3], [4]], (a, b) => a.length - b.length], [4]); }, }); Deno.test({ - name: "[collections/minWith] array of strings", + name: "minWith() handles array of strings", fn() { minWithTest( [["Kim", "Anna", "John"], (a, b) => a.length - b.length], @@ -47,7 +47,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/minWith] array of objects", + name: "minWith() handles array of objects", fn() { minWithTest( [ @@ -64,14 +64,14 @@ Deno.test({ }); Deno.test({ - name: "[collections/minWith] duplicates", + name: "minWith() handles duplicates", fn() { minWithTest([["John", "Kim", "Kim"], (a, b) => a.length - b.length], "Kim"); }, }); Deno.test({ - name: "[collections/minWith] array containing undefined", + name: "minWith() handles array containing undefined", fn() { minWithTest( [ diff --git a/collections/partition_entries_test.ts b/collections/partition_entries_test.ts index eb23f789dfc8..9115f4218f5e 100644 --- a/collections/partition_entries_test.ts +++ b/collections/partition_entries_test.ts @@ -13,7 +13,7 @@ function partitionEntriesTest( } Deno.test({ - name: "[collections/partitionEntries] no mutation", + name: "partitionEntries() handles no mutation", fn() { const object = { a: 5, b: true }; partitionEntries(object, ([key]) => key !== "a"); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partitionEntries] empty input", + name: "partitionEntries() handles empty input", fn() { partitionEntriesTest( [{}, () => true], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partitionEntries] identity", + name: "partitionEntries() handles identity", fn() { partitionEntriesTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partitionEntries] clean object", + name: "partitionEntries() handles clean object", fn() { partitionEntriesTest( [ @@ -67,7 +67,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partitionEntries] filters", + name: "partitionEntries() handles filters", fn() { partitionEntriesTest( [ diff --git a/collections/partition_test.ts b/collections/partition_test.ts index 100238301682..f7dd8cda5f44 100644 --- a/collections/partition_test.ts +++ b/collections/partition_test.ts @@ -13,7 +13,7 @@ function partitionTest( } Deno.test({ - name: "[collections/partition] no mutation", + name: "partition() handles no mutation", fn() { const array = [1, 2, 3]; partition(array, (it) => it % 2 === 0); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partition] empty input", + name: "partition() handles empty input", fn() { partitionTest( [[], () => true], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partition] all match", + name: "partition() handles all match", fn() { partitionTest( [[2, 4, 6], (it) => it % 2 === 0], @@ -47,7 +47,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partition] none match", + name: "partition() handles none match", fn() { partitionTest( [[3, 7, 5], (it) => it % 2 === 0], @@ -61,7 +61,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/partition] some match", + name: "partition() handles some match", fn() { partitionTest( [[13, 4, 13, 8], (it) => it % 2 === 0], diff --git a/collections/permutations_test.ts b/collections/permutations_test.ts index 33bfb893d871..5dcbe0f470a7 100644 --- a/collections/permutations_test.ts +++ b/collections/permutations_test.ts @@ -13,7 +13,7 @@ function permutationsTest( } Deno.test({ - name: "[collections/permutations] no mutation", + name: "permutations() handles no mutation", fn() { const array = [1, 2, 3]; permutations(array); @@ -23,7 +23,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/permutations] empty input", + name: "permutations() handles empty input", fn() { permutationsTest( [[]], @@ -33,7 +33,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/permutations] one element", + name: "permutations() handles one element", fn() { permutationsTest( [ @@ -51,7 +51,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/permutations] equality is ignored", + name: "permutations() ignores equality", fn() { permutationsTest( [[1, 1]], @@ -61,7 +61,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/permutations] examples", + name: "permutations() handles examples", fn() { permutationsTest( [["a", "b", "c"]], diff --git a/collections/reduce_groups_test.ts b/collections/reduce_groups_test.ts index b921bda38a7b..437ab5bbe247 100644 --- a/collections/reduce_groups_test.ts +++ b/collections/reduce_groups_test.ts @@ -17,7 +17,7 @@ function reduceGroupsTest( } Deno.test({ - name: "[collections/mapEntries] no mutation", + name: "mapEntries() handles no mutation", fn() { const input = { Woody: [2, 3, 1, 4], @@ -34,7 +34,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] array of numbers", + name: "mapEntries() handles array of numbers", fn() { reduceGroupsTest( [ @@ -54,7 +54,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] array of string", + name: "mapEntries() handles array of strings", fn() { reduceGroupsTest( [ @@ -74,7 +74,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] mapper", + name: "mapEntries() handles mapper", fn() { reduceGroupsTest( [ @@ -94,7 +94,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] initial value", + name: "mapEntries() handles initial value", fn() { reduceGroupsTest( [ @@ -114,7 +114,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/mapEntries] empty input", + name: "mapEntries() handles empty input", fn() { reduceGroupsTest([{}, () => 0, 0], {}); }, diff --git a/collections/running_reduce_test.ts b/collections/running_reduce_test.ts index 3a09a4599a38..8b1162aaa389 100644 --- a/collections/running_reduce_test.ts +++ b/collections/running_reduce_test.ts @@ -4,7 +4,7 @@ import { assertEquals } from "../assert/mod.ts"; import { runningReduce } from "./running_reduce.ts"; Deno.test({ - name: "[collections/runningReduce] no mutation", + name: "runningReduce() handles no mutation", fn() { const numbers = [1, 2, 3, 4, 5]; runningReduce(numbers, (sum, current) => sum + current, 0); @@ -14,7 +14,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] array of numbers initialValue 0", + name: "runningReduce() handles array of numbers initial value 0", fn() { const numbers = [1, 2, 3, 4, 5]; const result = runningReduce(numbers, (sum, current) => sum + current, 0); @@ -24,7 +24,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] array of numbers initialValue 5", + name: "runningReduce() handles array of numbers initial value 5", fn() { const numbers = [1, 2, 3, 4, 5]; const result = runningReduce(numbers, (sum, current) => sum + current, 5); @@ -34,7 +34,7 @@ Deno.test({ }); Deno.test({ - name: `[collections/runningReduce] array of strings initialValue ""`, + name: `runningReduce() handles array of strings initial value ""`, fn() { const strings = ["a", "b", "c", "d", "e"]; const result = runningReduce(strings, (str, current) => str + current, ""); @@ -44,7 +44,7 @@ Deno.test({ }); Deno.test({ - name: `[collections/runningReduce] array of strings initialValue "foo"`, + name: `runningReduce() handles array of strings initial value "foo"`, fn() { const strings = ["a", "b", "c", "d", "e"]; const result = runningReduce( @@ -58,7 +58,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] empty array initialValue 0", + name: "runningReduce() handles empty array initial value 0", fn() { const result = runningReduce([], (sum, current) => sum + current, 0); @@ -67,7 +67,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] empty array initialValue 5", + name: "runningReduce() handles empty array initial value 5", fn() { const result = runningReduce([], (sum, current) => sum + current, 5); @@ -76,7 +76,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] array of objects initialValue 0", + name: "runningReduce() handles array of objects initial value 0", fn() { const medals = [ { country: "USA", count: 113 }, @@ -94,7 +94,7 @@ Deno.test({ }); Deno.test({ - name: `[collections/runningReduce] array of objects initialValue ""`, + name: `runningReduce() handles array of objects initial value ""`, fn() { const medals = [ { country: "USA", count: 113 }, @@ -112,7 +112,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] reduce array of numbers with currentIndex", + name: "runningReduce() reduces array of numbers with currentIndex", fn() { const numbers = [1, 2, 3, 4, 5]; const result = runningReduce( @@ -126,7 +126,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] reduce array of strings with currentIndex", + name: "runningReduce() reduces array of strings with currentIndex", fn() { const strings = ["a", "b", "c", "d", "e"]; const result = runningReduce( @@ -140,7 +140,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/runningReduce] reduce array of objects with currentIndex", + name: "runningReduce() reduces array of objects with currentIndex", fn() { const medals = [ { country: "USA", count: 113 }, diff --git a/collections/sample_test.ts b/collections/sample_test.ts index c5e1e064c23e..37ef870eef7a 100644 --- a/collections/sample_test.ts +++ b/collections/sample_test.ts @@ -4,7 +4,7 @@ import { assert, assertEquals } from "../assert/mod.ts"; import { sample } from "./sample.ts"; Deno.test({ - name: "[collections/sample] no mutation", + name: "sample() handles no mutation", fn() { const array = ["a", "abc", "ba"]; sample(array); @@ -14,7 +14,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sample] empty input", + name: "sample() handles empty input", fn() { const actual = sample([]); assertEquals(actual, undefined); @@ -22,7 +22,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sample] array of number", + name: "sample() handles array of numbers", fn() { const input = [1, 2, 3]; const actual = sample([1, 2, 3]); @@ -32,7 +32,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sample] array of objects", + name: "sample() handles array of objects", fn() { const input = [ { diff --git a/collections/sliding_windows_test.ts b/collections/sliding_windows_test.ts index 613bdd3c773a..fbb093d37f43 100644 --- a/collections/sliding_windows_test.ts +++ b/collections/sliding_windows_test.ts @@ -37,7 +37,7 @@ function slidingWindowsThrowsTest( } Deno.test({ - name: "[collections/slidingWindows] no mutation", + name: "slidingWindows() handles no mutation", fn() { const numbers = [1, 2, 3, 4, 5]; slidingWindows(numbers, 3); @@ -46,7 +46,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] empty input", + name: "slidingWindows() handles empty input", fn() { slidingWindowsTest([[], 3], []); slidingWindowsTest([[], 3, {}], []); @@ -57,7 +57,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] default option", + name: "slidingWindows() handles default option", fn() { slidingWindowsTest([[1, 2, 3, 4, 5], 5], [ [1, 2, 3, 4, 5], @@ -78,7 +78,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] step option", + name: "slidingWindows() handles step option", fn() { slidingWindowsTest([[1, 2, 3, 4, 5], 5, { step: 2 }], [ [1, 2, 3, 4, 5], @@ -96,7 +96,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] partial option", + name: "slidingWindows() handles partial option", fn() { slidingWindowsTest([[1, 2, 3, 4, 5], 5, { partial: true }], [ [1, 2, 3, 4, 5], @@ -123,7 +123,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] step and partial option", + name: "slidingWindows() handles step and partial option", fn() { slidingWindowsTest([[1, 2, 3, 4, 5], 5, { step: 2, partial: true }], [ [1, 2, 3, 4, 5], @@ -144,7 +144,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] invalid size or step: other than number", + name: "slidingWindows() handles invalid size or step: other than number", fn() { slidingWindowsThrowsTest( [[1, 2, 3, 4, 5], NaN], @@ -172,7 +172,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] invalid size or step: not integer number", + name: "slidingWindows() handles invalid size or step: not integer number", fn() { slidingWindowsThrowsTest( [[1, 2, 3, 4, 5], 0.5], @@ -198,8 +198,7 @@ Deno.test({ }); Deno.test({ - name: - "[collections/slidingWindows] invalid size or step: not positive number", + name: "slidingWindows() handles invalid size or step: not positive number", fn() { slidingWindowsThrowsTest( [[1, 2, 3, 4, 5], 0], @@ -225,7 +224,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] invalid size or step: infinity", + name: "slidingWindows() handles invalid size or step: infinity", fn() { slidingWindowsThrowsTest( [[1, 2, 3, 4, 5], Number.NEGATIVE_INFINITY], @@ -251,7 +250,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] large size", + name: "slidingWindows() handles large size", fn() { slidingWindowsTest([[1, 2, 3, 4, 5], 100], []); slidingWindowsTest([[1, 2, 3, 4, 5], 100, { step: 2 }], []); @@ -264,7 +263,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] large step", + name: "slidingWindows() handles large step", fn() { slidingWindowsTest([[1, 2, 3, 4, 5], 3, { step: 100 }], [ [1, 2, 3], @@ -276,7 +275,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/slidingWindows] empty Array", + name: "slidingWindows() handles empty Array", fn() { slidingWindowsTest([Array(5), 5], [ Array(5), diff --git a/collections/sort_by_test.ts b/collections/sort_by_test.ts index 1adac52f689f..a8afa611cf44 100644 --- a/collections/sort_by_test.ts +++ b/collections/sort_by_test.ts @@ -4,7 +4,7 @@ import { assertEquals } from "../assert/mod.ts"; import { sortBy } from "./sort_by.ts"; Deno.test({ - name: "[collections/sortBy] no mutation", + name: "sortBy() handles no mutation", fn() { const array = ["a", "abc", "ba"]; sortBy(array, (it) => it.length); @@ -14,7 +14,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] calls the selector function once", + name: "sortBy() calls the selector function once", fn() { let callCount = 0; const array = [0, 1, 2]; @@ -28,21 +28,21 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] empty input", + name: "sortBy() handles empty input", fn() { assertEquals(sortBy([], () => 5), []); }, }); Deno.test({ - name: "[collections/sortBy] identity selector", + name: "sortBy() handles identity selector", fn() { assertEquals(sortBy([2, 3, 1], (it) => it), [1, 2, 3]); }, }); Deno.test({ - name: "[collections/sortBy] stable sort", + name: "sortBy() handles stable sort", fn() { assertEquals( sortBy([ @@ -81,7 +81,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] special number values", + name: "sortBy() handles special number values", fn() { assertEquals( sortBy([ @@ -147,7 +147,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] sortings", + name: "sortBy() handles sortings", fn() { const testArray = [ { name: "benchmark", stage: 3 }, @@ -199,7 +199,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/sortBy] desc ordering", + name: "sortBy() handles desc ordering", fn() { assertEquals( sortBy( diff --git a/collections/sum_of_test.ts b/collections/sum_of_test.ts index aea33c3ab106..1a7da8198452 100644 --- a/collections/sum_of_test.ts +++ b/collections/sum_of_test.ts @@ -3,7 +3,7 @@ import { assertEquals } from "../assert/mod.ts"; import { sumOf } from "./sum_of.ts"; -Deno.test("[collections/sumOf] On object properties", () => { +Deno.test("sumOf() handles object properties", () => { const object = [ { name: "Kyle", age: 34 }, { name: "John", age: 42 }, @@ -15,7 +15,7 @@ Deno.test("[collections/sumOf] On object properties", () => { assertEquals(actual, 99); }); -Deno.test("[collections/sumOf] Add 2 to each num", () => { +Deno.test("sumOf() adds 2 to each num", () => { const array = [1, 2, 3]; const actual = sumOf(array, (i) => i + 2); @@ -23,7 +23,7 @@ Deno.test("[collections/sumOf] Add 2 to each num", () => { assertEquals(actual, 12); }); -Deno.test("[collections/sumOf] Regular sum", () => { +Deno.test("sumOf() handles regular sum", () => { const array = [1, 2, 3]; const actual = sumOf(array, (i) => i); @@ -31,7 +31,7 @@ Deno.test("[collections/sumOf] Regular sum", () => { assertEquals(actual, 6); }); -Deno.test("[collections/sumOf] Negatives with regular sum", () => { +Deno.test("sumOf() handles negatives with regular sum", () => { const array = [-1, -2, -3]; const actual = sumOf(array, (i) => i); @@ -39,7 +39,7 @@ Deno.test("[collections/sumOf] Negatives with regular sum", () => { assertEquals(actual, -6); }); -Deno.test("[collections/sumOf] Mixed negatives and positives with regular sum", () => { +Deno.test("sumOf() handles mixed negatives and positives with regular sum", () => { const array = [-1, 2, 3, -5]; const actual = sumOf(array, (i) => i); @@ -47,7 +47,7 @@ Deno.test("[collections/sumOf] Mixed negatives and positives with regular sum", assertEquals(actual, -1); }); -Deno.test("[collections/sumBy] Selector turns nums into negatives", () => { +Deno.test("sumOf() turns selector nums into negatives", () => { const array = [1, 3, 5, 3]; const actual = sumOf(array, (i) => i - 6); @@ -55,7 +55,7 @@ Deno.test("[collections/sumBy] Selector turns nums into negatives", () => { assertEquals(actual, -12); }); -Deno.test("[collections/sumBy] Selector turns nums into zeros", () => { +Deno.test("sumOf() turns selector nums into zeros", () => { const array = [3, 3, 3, 3]; const actual = sumOf(array, (i) => i - 3); @@ -63,7 +63,7 @@ Deno.test("[collections/sumBy] Selector turns nums into zeros", () => { assertEquals(actual, 0); }); -Deno.test("[collections/sumOf] On negative object properties", () => { +Deno.test("sumOf() handles negative object properties", () => { const object = [ { name: "Kyle", age: -34 }, { name: "John", age: -42 }, @@ -75,7 +75,7 @@ Deno.test("[collections/sumOf] On negative object properties", () => { assertEquals(actual, -99); }); -Deno.test("[collections/sumOf] On mixed object properties", () => { +Deno.test("sumOf() handles mixed object properties", () => { const object = [ { name: "Kyle", age: -34 }, { name: "John", age: 42 }, @@ -87,7 +87,7 @@ Deno.test("[collections/sumOf] On mixed object properties", () => { assertEquals(actual, -15); }); -Deno.test("[collections/sumOf] No mutation", () => { +Deno.test("sumOf() handles no mutation", () => { const array = [1, 2, 3, 4]; sumOf(array, (i) => i + 2); @@ -95,7 +95,7 @@ Deno.test("[collections/sumOf] No mutation", () => { assertEquals(array, [1, 2, 3, 4]); }); -Deno.test("[collections/sumOf] Empty array results in 0", () => { +Deno.test("sumOf() handles empty array results in 0", () => { const array: number[] = []; const actual = sumOf(array, (i) => i + 2); @@ -103,7 +103,7 @@ Deno.test("[collections/sumOf] Empty array results in 0", () => { assertEquals(actual, 0); }); -Deno.test("[collections/sumOf] NaN and Infinity", () => { +Deno.test("sumOf() handles NaN and Infinity", () => { const array = [ 1, 2, @@ -123,7 +123,7 @@ Deno.test("[collections/sumOf] NaN and Infinity", () => { assertEquals(actual, NaN); }); -Deno.test("[collections/sumOf] Infinity", () => { +Deno.test("sumOf() handles Infinity", () => { const array = [1, 2, Infinity, 3, 4, 5, 6, 7, 8]; const actual = sumOf(array, (i) => i); diff --git a/collections/take_last_while_test.ts b/collections/take_last_while_test.ts index 7745daad4acb..ea8f0939f7b5 100644 --- a/collections/take_last_while_test.ts +++ b/collections/take_last_while_test.ts @@ -3,28 +3,28 @@ import { assertEquals } from "../assert/mod.ts"; import { takeLastWhile } from "./take_last_while.ts"; -Deno.test("[collections/takeLastWhile] Num array", () => { +Deno.test("takeLastWhile() handles num array", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = takeLastWhile(arr, (i) => i !== 4); assertEquals(actual, [5, 6]); }); -Deno.test("[collections/takeLastWhile] Add two to each num in predicate", () => { +Deno.test("takeLastWhile() adds two to each num in predicate", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = takeLastWhile(arr, (i) => i + 2 !== 6); assertEquals(actual, [5, 6]); }); -Deno.test("[collections/takeLastWhile] Negatives", () => { +Deno.test("takeLastWhile() handles negatives", () => { const arr = [-1, -2, -3, -4, -5, -6]; const actual = takeLastWhile(arr, (i) => i < -4); assertEquals(actual, [-5, -6]); }); -Deno.test("[collections/takeLastWhile] No mutation", () => { +Deno.test("takeLastWhile() handles no mutation", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = takeLastWhile(arr, (i) => i !== 4); @@ -32,7 +32,7 @@ Deno.test("[collections/takeLastWhile] No mutation", () => { assertEquals(arr, [1, 2, 3, 4, 5, 6]); }); -Deno.test("[collections/takeLastWhile] Empty input array returns empty array", () => { +Deno.test("takeLastWhile() handles empty input array returns empty array", () => { const arr: number[] = []; const actual = takeLastWhile(arr, (i) => i > 4); @@ -40,7 +40,7 @@ Deno.test("[collections/takeLastWhile] Empty input array returns empty array", ( assertEquals(actual, []); }); -Deno.test("[collections/takeLastWhile] Returns empty array when the last element doesn't match the predicate", () => { +Deno.test("takeLastWhile() returns empty array when the last element doesn't match the predicate", () => { const arr = [1, 2, 3, 4]; const actual = takeLastWhile(arr, (i) => i !== 4); @@ -48,7 +48,7 @@ Deno.test("[collections/takeLastWhile] Returns empty array when the last element assertEquals(actual, []); }); -Deno.test("[collections/takeLastWhile] Returns the same array when all elements match the predicate", () => { +Deno.test("takeLastWhile() returns the same array when all elements match the predicate", () => { const arr = [1, 2, 3, 4]; const actual = takeLastWhile(arr, (i) => i !== 400); diff --git a/collections/take_while_test.ts b/collections/take_while_test.ts index 431514fde015..afeabb4f626d 100644 --- a/collections/take_while_test.ts +++ b/collections/take_while_test.ts @@ -3,28 +3,28 @@ import { assertEquals } from "../assert/mod.ts"; import { takeWhile } from "./take_while.ts"; -Deno.test("[collections/takeWhile] Num array", () => { +Deno.test("takeWhile() handles num array", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = takeWhile(arr, (i) => i !== 4); assertEquals(actual, [1, 2, 3]); }); -Deno.test("[collections/takeWhile] Add two to each num in predicate", () => { +Deno.test("takeWhile() adds two to each num in predicate", () => { const arr = [1, 2, 3, 4, 5, 6]; const actual = takeWhile(arr, (i) => i + 2 !== 6); assertEquals(actual, [1, 2, 3]); }); -Deno.test("[collections/takeWhile] Negatives", () => { +Deno.test("takeWhile() handles negatives", () => { const arr = [-1, -2, -3, -4, -5, -6]; const actual = takeWhile(arr, (i) => i > -4); assertEquals(actual, [-1, -2, -3]); }); -Deno.test("[collections/takeWhile] No mutation", () => { +Deno.test("takeWhile() handles no mutation", () => { const arr = [-1, -2, -3, -4, -5, -6]; const actual = takeWhile(arr, (i) => i > -4); @@ -32,7 +32,7 @@ Deno.test("[collections/takeWhile] No mutation", () => { assertEquals(arr, [-1, -2, -3, -4, -5, -6]); }); -Deno.test("[collections/takeWhile] Empty input array returns empty array", () => { +Deno.test("takeWhile() handles empty input array returns empty array", () => { const arr: number[] = []; const actual = takeWhile(arr, (i) => i > 4); @@ -40,7 +40,7 @@ Deno.test("[collections/takeWhile] Empty input array returns empty array", () => assertEquals(actual, []); }); -Deno.test("[collections/takeWhile] Returns empty array when the first element doesn't match the predicate", () => { +Deno.test("takeWhile() returns empty array when the first element doesn't match the predicate", () => { const arr = [1, 2, 3, 4]; const actual = takeWhile(arr, (i) => i !== 1); @@ -48,7 +48,7 @@ Deno.test("[collections/takeWhile] Returns empty array when the first element do assertEquals(actual, []); }); -Deno.test("[collections/takeWhile] Returns the same array when all elements match the predicate", () => { +Deno.test("takeWhile() returns the same array when all elements match the predicate", () => { const arr = [1, 2, 3, 4]; const actual = takeWhile(arr, (i) => i !== 400); diff --git a/collections/union_test.ts b/collections/union_test.ts index 2d5da45145f4..cb2ac0c7d38f 100644 --- a/collections/union_test.ts +++ b/collections/union_test.ts @@ -13,7 +13,7 @@ function unionTest( } Deno.test({ - name: "[collections/union] no mutations", + name: "union() handles no mutations", fn() { const arrayA = [1, 2, 3]; const arrayB = [2, 4, 5]; @@ -25,14 +25,14 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] empty input", + name: "union() handles empty input", fn() { unionTest([], []); }, }); Deno.test({ - name: "[collections/union] empty arrays", + name: "union() handles empty arrays", fn() { unionTest( [ @@ -46,7 +46,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] one input", + name: "union() handles one input", fn() { unionTest( [ @@ -64,7 +64,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] some empty", + name: "union() handles some empty", fn() { unionTest([[], ["a", "b", "c"]], ["a", "b", "c"]); unionTest([["a", "b", "c"], []], ["a", "b", "c"]); @@ -73,7 +73,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] distinct sets", + name: "union() handles distinct sets", fn() { unionTest([["a", "b", "c"], ["d", "e", "f"]], [ "a", @@ -105,7 +105,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] overlapping sets", + name: "union() handles overlapping sets", fn() { unionTest([["a", "b"], ["b", "c"]], ["a", "b", "c"]); unionTest( @@ -120,7 +120,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] objects", + name: "union() handles objects", fn() { const a = { foo: "bar" }; const b = { bar: "baz" }; @@ -147,7 +147,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/union] functions", + name: "union() handles functions", fn() { const a = () => {}; const b = () => null; diff --git a/collections/unzip_test.ts b/collections/unzip_test.ts index ea09746bb409..079afdca72cb 100644 --- a/collections/unzip_test.ts +++ b/collections/unzip_test.ts @@ -13,7 +13,7 @@ function unzipTest( } Deno.test({ - name: "[collections/unzip] no mutation", + name: "unzip() handles no mutation", fn() { const zipped: Array<[number, boolean]> = [ [1, true], @@ -31,7 +31,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/unzip] empty input", + name: "unzip() handles empty input", fn() { unzipTest( [[]], @@ -41,7 +41,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/unzip] unzips", + name: "unzip() handles unzips", fn() { unzipTest( [ diff --git a/collections/without_all_test.ts b/collections/without_all_test.ts index 649ab27451ef..e27bdd170226 100644 --- a/collections/without_all_test.ts +++ b/collections/without_all_test.ts @@ -14,7 +14,7 @@ function withoutAllTest( } Deno.test({ - name: "[collections/withoutAll] no mutation", + name: "withoutAll() handles no mutation", fn() { const array = [1, 2, 3, 4]; withoutAll(array, [2, 3]); @@ -23,21 +23,21 @@ Deno.test({ }); Deno.test({ - name: "[collections/withoutAll] empty input", + name: "withoutAll() handles empty input", fn() { withoutAllTest([], [], []); }, }); Deno.test({ - name: "[collections/withoutAll] no matches", + name: "withoutAll() handles no matches", fn() { withoutAllTest([1, 2, 3, 4], [0, 7, 9], [1, 2, 3, 4]); }, }); Deno.test({ - name: "[collections/withoutAll] single matche", + name: "withoutAll() handles single match", fn() { withoutAllTest([1, 2, 3, 4], [1], [2, 3, 4]); withoutAllTest([1, 2, 3, 2], [2], [1, 3]); @@ -45,7 +45,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/withoutAll] multiple matches", + name: "withoutAll() handles multiple matches", fn() { withoutAllTest([1, 2, 3, 4, 6, 3], [1, 2], [3, 4, 6, 3]); withoutAllTest([7, 2, 9, 8, 7, 6, 5, 7], [7, 9], [2, 8, 6, 5]); @@ -53,7 +53,7 @@ Deno.test({ }); Deno.test({ - name: "[collection/withoutAll] leaves duplicate elements", + name: "withoutAll() leaves duplicate elements", fn() { withoutAllTest( Array.from({ length: 110 }, () => 3), diff --git a/collections/zip_test.ts b/collections/zip_test.ts index 9ed95d4901bc..aed57ccd0785 100644 --- a/collections/zip_test.ts +++ b/collections/zip_test.ts @@ -15,7 +15,7 @@ function zip1Test( assertEquals(zip([]), []); Deno.test({ - name: "[collections/zip] Correctly zips one array", + name: "zip() handles one array", fn() { zip1Test([ [1, 2, 3], @@ -42,7 +42,7 @@ function zip3Test( } Deno.test({ - name: "[collections/zip] Correctly zips three arrays", + name: "zip() handles three arrays", fn() { zip3Test([ [1, 2, 3], @@ -53,8 +53,7 @@ Deno.test({ }); Deno.test({ - name: - "[collections/zip] Correctly zips three arrays when the first is the shortest", + name: "zip() handles three arrays when the first is the shortest", fn() { zip3Test([ [1, 2], @@ -65,7 +64,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/zip] no mutation", + name: "zip() handles no mutation", fn() { const arrayA = [1, 4, 5]; const arrayB = ["foo", "bar"]; @@ -77,7 +76,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/zip] empty input", + name: "zip() handles empty input", fn() { zipTest( [[], []], @@ -96,7 +95,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/zip] same length", + name: "zip() handles same length", fn() { zipTest( [ @@ -123,7 +122,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/zip] first shorter", + name: "zip() handles first shorter", fn() { zipTest( [ @@ -146,7 +145,7 @@ Deno.test({ }); Deno.test({ - name: "[collections/zip] second shorter", + name: "zip() handles second shorter", fn() { zipTest( [