Skip to content

Commit

Permalink
chore: add fs system cache update test in cache.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Jan 5, 2025
1 parent 5fa8904 commit ea4cb96
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/rss-libs/test/middleware/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ describe("cache test suite", () => {
expect(await cache.get(key)).toBeNull();
});

it("should support fs system cache (update)", async () => {
const cache = new FileSystemCache();
await cache.syncReady();
const key = uuid.v4();
const v1 = uuid.v4();
await cache.set(key, v1, 0.5);
expect(await cache.get(key)).toBe(v1);
await cache.set(key, v1 + "2", 0.5);
expect(await cache.get(key)).toBe(v1 + "2");
});


if (process.env.REDIS_URL !== undefined) {
it("should support redis cache", async () => {
const client = new RedisCache();
Expand Down

0 comments on commit ea4cb96

Please sign in to comment.