begin integration of improved indexeddb code

refactored SlopDB class to contain a CheckCache object, as there was a circular dependency previously
This commit is contained in:
Jack Case
2026-01-05 19:03:49 +00:00
parent 1ab268407b
commit ab29ecd3ae
3 changed files with 25 additions and 45 deletions

View File

@@ -62,7 +62,7 @@ describe("SlopDB", () => {
})
it("caches a checked url", async () => {
const cache = slopdb.get_check_cache()
const cache = slopdb.check_cache
expect(cache).toBeInstanceOf(CheckCache)
const slop_url = new URL("https://sloppy-slop.com/sloparticle")
@@ -81,7 +81,7 @@ describe("SlopDB", () => {
it("updates a cached url's timestamp when it is accessed", async () => {
const cache = slopdb.get_check_cache()
const cache = slopdb.check_cache
const slop_url = new URL("https://sloppy-slop.com/sloparticle")
await cache.store(slop_url.toString())
@@ -94,7 +94,7 @@ describe("SlopDB", () => {
})
it("evicts the least recently accessed URL when an item is added to a full cache", async () => {
const cache = slopdb.get_check_cache()
const cache = slopdb.check_cache
cache.cache_capacity = 2
const slop_url = new URL("https://sloppy-slop.com/sloparticle")