From 6ab3d931c9e5dfb99480f266cb1bb4cbb0fcf16c Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Thu, 2 Oct 2025 15:50:58 -0700 Subject: [PATCH] opsie --- test/js/valkey/valkey.connecting.fixture.ts | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/js/valkey/valkey.connecting.fixture.ts diff --git a/test/js/valkey/valkey.connecting.fixture.ts b/test/js/valkey/valkey.connecting.fixture.ts new file mode 100644 index 0000000000..9a167758d6 --- /dev/null +++ b/test/js/valkey/valkey.connecting.fixture.ts @@ -0,0 +1,28 @@ +import { RedisClient } from "bun"; + +function getOptions() { + if (process.env.BUN_VALKEY_TLS) { + const paths = JSON.parse(process.env.BUN_VALKEY_TLS); + return { + tls: { + key: Bun.file(paths.key), + cert: Bun.file(paths.cert), + ca: Bun.file(paths.ca), + }, + }; + } + return {}; +} + +{ + const client = new RedisClient(process.env.BUN_VALKEY_URL, getOptions()); + client + .connect() + .then(redis => { + console.log("connected"); + client.close(); + }) + .catch(err => { + console.error(err); + }); +}