Skip to content

Commit

Permalink
test: fix vercel-kv test
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 5, 2023
1 parent b47acd1 commit 329496c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions test/drivers/vercel-kv.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import { describe } from "vitest";
import driver from "../../src/drivers/vercel-kv";
import { describe, it } from "vitest";
// import driver from "../../src/drivers/vercel-kv";
import { testDriver } from "./utils";

// TODO: Only works locally with env. Mock upstash client to run in CI

const hasEnv = process.env.KV_REST_API_URL && process.env.KV_REST_API_TOKEN;

describe.skipIf(!hasEnv)("drivers: vercel-kv", () => {
testDriver({
driver: driver({}),
if (hasEnv) {
describe("drivers: vercel-kv", async () => {
const driver = await import("../../src/drivers/vercel-kv").then(
(r) => r.default
);
testDriver({
driver: driver({}),
});
});
});
} else {
// TODO: vitest describe.skipIf has no effect!!
describe("drivers: vercel-kv", () => {
it.skip("", () => {});
});
}

0 comments on commit 329496c

Please sign in to comment.