Skip to content

Commit 0765721

Browse files
Update cache.test.js
1 parent 83052fa commit 0765721

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/cache.test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ describe("LRU Cache test", () => {
7272
cache.set("d", 40);
7373
cache.set("e", 50);
7474
expect(cache.toArray()).toEqual([
75-
{ e: 50 },
76-
{ d: 40 },
77-
{ c: 30 },
7875
{ b: 20 },
76+
{ c: 30 },
77+
{ d: 40 },
78+
{ e: 50 },
7979
]);
8080
});
8181

@@ -87,10 +87,10 @@ describe("LRU Cache test", () => {
8787
cache.get("a");
8888
cache.set("e", 50);
8989
expect(cache.toArray()).toEqual([
90-
{ e: 50 },
91-
{ a: 10 },
92-
{ d: 40 },
9390
{ c: 30 },
91+
{ d: 40 },
92+
{ a: 10 },
93+
{ e: 50 },
9494
]);
9595
});
9696

@@ -102,10 +102,10 @@ describe("LRU Cache test", () => {
102102
cache.get("d");
103103
cache.set("e", 50);
104104
expect(cache.toArray()).toEqual([
105-
{ e: 50 },
106-
{ d: 40 },
107-
{ c: 30 },
108105
{ b: 20 },
106+
{ c: 30 },
107+
{ d: 40 },
108+
{ e: 50 },
109109
]);
110110
});
111111

@@ -124,7 +124,7 @@ describe("LRU Cache test", () => {
124124
test("Get all data as array", async () => {
125125
cache.set("a", 10);
126126
cache.set("b", 20, { ttl: 0 });
127-
expect(cache.toArray()).toEqual([{ b: 20 }, { a: 10 }]);
127+
expect(cache.toArray()).toEqual([{ a: 10 }, { b: 20 }]);
128128
await new Promise((resolve, reject) => {
129129
setTimeout(() => resolve(), 200);
130130
});

0 commit comments

Comments
 (0)