Migrate to vitest from jest (#1074)
Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com> Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
parent
324d471158
commit
98df118a4c
1 changed files with 1713 additions and 3434 deletions
|
|
@ -203,7 +203,7 @@ describe('ResourceTemplate', () => {
|
|||
* Test: ResourceTemplate with List Callback
|
||||
*/
|
||||
test('should create ResourceTemplate with list callback', async () => {
|
||||
const list = jest.fn().mockResolvedValue({
|
||||
const list = vi.fn().mockResolvedValue({
|
||||
resources: [{ name: 'Test', uri: 'test://example' }]
|
||||
});
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ describe('ResourceTemplate', () => {
|
|||
|
||||
describe('tool()', () => {
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
/***
|
||||
|
|
@ -1705,7 +1705,7 @@ describe('tool()', () => {
|
|||
});
|
||||
|
||||
// Spy on console.warn to verify warnings are logged
|
||||
const warnSpy = jest.spyOn(console, 'warn').mockImplementation();
|
||||
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
|
||||
// Test valid tool names
|
||||
testServer.registerTool(
|
||||
|
|
@ -4067,15 +4067,15 @@ describe('Tool title precedence', () => {
|
|||
});
|
||||
|
||||
describe('elicitInput()', () => {
|
||||
const checkAvailability = jest.fn().mockResolvedValue(false);
|
||||
const findAlternatives = jest.fn().mockResolvedValue([]);
|
||||
const makeBooking = jest.fn().mockResolvedValue('BOOKING-123');
|
||||
const checkAvailability = vi.fn().mockResolvedValue(false);
|
||||
const findAlternatives = vi.fn().mockResolvedValue([]);
|
||||
const makeBooking = vi.fn().mockResolvedValue('BOOKING-123');
|
||||
|
||||
let mcpServer: McpServer;
|
||||
let client: Client;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
vi.clearAllMocks();
|
||||
|
||||
// Create server with restaurant booking tool
|
||||
mcpServer = new McpServer({
|
||||
|
|
|
|||
Loading…
Reference in a new issue