Skip to content

Commit 1415205

Browse files
committed
Integration -> Unit
1 parent caa7792 commit 1415205

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

tests/integration/tools/assistant/assistantHelpers.ts renamed to tests/unit/assistant/assistantHelpers.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import { setupIntegrationTest, IntegrationTest, defaultTestConfig, defaultDriverOptions } from "../../helpers.js";
1+
import {
2+
setupIntegrationTest,
3+
IntegrationTest,
4+
defaultTestConfig,
5+
defaultDriverOptions,
6+
} from "../../integration/helpers.js";
27
import { describe, SuiteCollector } from "vitest";
38
import { vi, beforeAll, afterAll, beforeEach } from "vitest";
49

5-
export type IntegrationTestFunction = (integration: IntegrationTest) => void;
10+
export type MockIntegrationTestFunction = (integration: IntegrationTest) => void;
611

7-
export function describeWithAssistant(name: string, fn: IntegrationTestFunction): SuiteCollector<object> {
12+
export function describeWithAssistant(name: string, fn: MockIntegrationTestFunction): SuiteCollector<object> {
813
const testDefinition = (): void => {
914
const integration = setupIntegrationTest(
1015
() => ({
1116
...defaultTestConfig,
12-
assistantBaseUrl: "https://knowledge.test.mongodb.com/api/", // Not a real URL
17+
assistantBaseUrl: "https://knowledge-mock.mongodb.com/api/v1", // Not a real URL
1318
}),
1419
() => ({
1520
...defaultDriverOptions,
@@ -22,7 +27,7 @@ export function describeWithAssistant(name: string, fn: IntegrationTestFunction)
2227
};
2328

2429
// eslint-disable-next-line vitest/valid-describe-callback
25-
return describe("assistant", testDefinition);
30+
return describe("assistant (mocked)", testDefinition);
2631
}
2732

2833
/**

tests/integration/tools/assistant/listKnowledgeSources.test.ts renamed to tests/unit/assistant/listKnowledgeSources.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
validateToolMetadata,
66
getResponseElements,
77
getDataFromUntrustedContent,
8-
} from "../../helpers.js";
8+
} from "../../integration/helpers.js";
99
import { describeWithAssistant, makeMockAssistantAPI } from "./assistantHelpers.js";
1010
import { parse as yamlParse } from "yaml";
1111

tests/integration/tools/assistant/searchKnowledge.test.ts renamed to tests/unit/assistant/searchKnowledge.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
validateThrowsForInvalidArguments,
77
getResponseElements,
88
getDataFromUntrustedContent,
9-
} from "../../helpers.js";
9+
} from "../../integration/helpers.js";
1010
import { describeWithAssistant, makeMockAssistantAPI } from "./assistantHelpers.js";
1111
import { parse as yamlParse } from "yaml";
1212

0 commit comments

Comments
 (0)