-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
41 lines (27 loc) · 916 Bytes
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import sortBy from "./index";
test("works", () => {
expect(sortBy(({id}) => id)([{id: 3}, {id: 1}, {id: 2}])).toEqual([{id: 1}, {id: 2}, {id: 3}]);
t.done();
});
test("works", () => {
expect(sortBy(({id}) => id)([{id: 1}, {id: 2}, {id: 3}])).toEqual([{id: 1}, {id: 2}, {id: 3}]);
t.done();
});
test("works", () => {
expect(sortBy(({id}) => id)([{id: 1}, {id: 2}, {id: 1}])).toEqual([{id: 1}, {id: 1}, {id: 2}]);
t.done();
});
test("works", () => {
expect(
sortBy(({id}) => id)([{id: "ad2e123"}, {id: "123123dd"}, {id: "asd2o3o1"}])
).toEqual([{id: "123123dd"}, {id: "ad2e123"}, {id: "asd2o3o1"}]);
t.done();
});
test("works", () => {
expect(sortBy(({id}) => id)([{id: true}, {id: false}, {id: true}])).toEqual([{id: false}, {id: true}, {id: true}]);
t.done();
});
test("works", () => {
expect(sortBy(({length}) => length)(["ac", "b"])).toEqual(["b", "ac"]);
t.done();
});