Skip to content

Commit

Permalink
test: fix KurtCache tests to not try to delete a dir that doesn't e…
Browse files Browse the repository at this point in the history
…xist
  • Loading branch information
jemc committed Dec 3, 2024
1 parent 3d654d0 commit f5d9348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/kurt-cache/spec/KurtCache.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, test, expect } from "@jest/globals"
import { readFileSync, readdirSync, rmdir, rmdirSync } from "node:fs"
import { existsSync, readFileSync, readdirSync, rmdirSync } from "node:fs"
import { randomBytes } from "node:crypto"
import {
Kurt,
Expand Down Expand Up @@ -65,7 +65,7 @@ describe("KurtCache", () => {
test("when cache misses, runs the adapter setup fn just once", async () => {
// Remove the cache dir first, to demonstrate that the cache dir will be
// automatically created by the KurtCache adapter.
rmdirSync(cacheDir, { recursive: true })
if (existsSync(cacheDir)) rmdirSync(cacheDir, { recursive: true })

// Use a random string to ensure an initial cache miss for this test run.
const random = randomBytes(8).toString("hex")
Expand Down

0 comments on commit f5d9348

Please sign in to comment.