Skip to content

Commit c34ac17

Browse files
Add tests and typings for array/are
1 parent 3c4e729 commit c34ac17

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

array/are.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
import are from "./are.ts";
44

55
describe("are", () => {
6-
it("TODO", () => {
7-
expect(are()).toBeDefined();
6+
it("returns true if the given arguments are all arrays", () => {
7+
expect(are([2, 3])).toBe(true);
8+
expect(are([1, 2, 3], [])).toBe(true);
9+
expect(are([1, 2, 3], 8, [1, 3], "test")).toBe(false);
10+
});
11+
12+
it("returns true for empty list of arguments", () => {
13+
expect(are()).toBe(true);
814
});
915
});

array/are.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import is from "./is";
22

3-
export default (...xs) => xs.every(is);
3+
export default (...xs: any[]): boolean => xs.every(is);

0 commit comments

Comments
 (0)