Skip to content

Commit 75092a8

Browse files
committed
apply copilot suggestion
1 parent 2d3b74e commit 75092a8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/accuracy/createIndex.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
import { afterAll, beforeAll } from "vitest";
12
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
23
import { Matcher } from "./sdk/matcher.js";
34

4-
process.env.MDB_VOYAGE_API_KEY = "valid-key";
5+
let originalApiKey: string | undefined;
6+
beforeAll(() => {
7+
originalApiKey = process.env.MDB_VOYAGE_API_KEY;
8+
9+
// We just need a valid key when registering the tool, the actual value is not important
10+
if (!originalApiKey) {
11+
process.env.MDB_VOYAGE_API_KEY = "valid-key";
12+
}
13+
});
14+
afterAll(() => {
15+
process.env.MDB_VOYAGE_API_KEY = originalApiKey;
16+
});
517

618
describeAccuracyTests([
719
{

0 commit comments

Comments
 (0)