test-fixtures.ts•611 B
import { test as base } from 'vitest';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { createTestClient } from './test-setup.js';
type TestFixtures = {
client: Client;
};
export const test = base.extend<TestFixtures>({
client: async ({}, use) => {
// Create fresh client for each test
const testSetup = await createTestClient('mcpman-test-client');
const client = testSetup.client;
// Provide client to test
await use(client);
// Clean up after test
await client.close();
},
});
export { expect, describe, beforeAll, afterAll } from 'vitest';