Skip to content

Commit 16121e3

Browse files
committed
revert before/afterAll solution for createIndex.test.ts
1 parent 8ec9c59 commit 16121e3

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

tests/accuracy/createIndex.test.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
import { afterAll, beforeAll } from "vitest";
21
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
32
import { Matcher } from "./sdk/matcher.js";
43

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-
});
4+
// TODO: supply this with a proper config API once we refactor describeAccuracyTests to support it
5+
process.env.MDB_VOYAGE_API_KEY = "valid-key";
176

187
describeAccuracyTests([
198
{

tests/accuracy/export.test.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,20 @@ describeAccuracyTests([
114114
arguments: {
115115
pipeline: [
116116
{
117-
$group: {
118-
_id: "$release_year",
119-
titles: {
120-
$push: "$title",
121-
},
122-
},
117+
$group: Matcher.anyOf(
118+
Matcher.value({
119+
_id: "$release_year",
120+
titles: {
121+
$push: "$title",
122+
},
123+
}),
124+
Matcher.value({
125+
_id: "$release_year",
126+
movies: {
127+
$push: "$title",
128+
},
129+
})
130+
),
123131
},
124132
],
125133
},

0 commit comments

Comments
 (0)