Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

stdio.test.ts

24 lines779 Bytes

1import { describe, expect, it } from 'vitest'
2import { stdioTransport } from '../src/stdio'
3​
4describe('stdioTransport', () => {
5 it('builds a Transport instance without starting it', () => {
6 const transport = stdioTransport({
7 command: 'node',
8 args: ['server.js'],
9 env: { MCP_TEST: '1' },
10 cwd: 'C:\\mcp',
11 })
12 expect(transport.constructor.name).toBe('StdioClientTransport')
13 expect(typeof transport.start).toBe('function')
14 expect(typeof transport.send).toBe('function')
15 expect(typeof transport.close).toBe('function')
16 expect(transport.pid).toBeNull()
17 expect(Reflect.get(transport, '_serverParams')).toEqual({
18 command: 'node',
19 args: ['server.js'],
20 env: { MCP_TEST: '1' },
21 cwd: 'C:\\mcp',
22 })
23 })
24})