Buckets:
| import path from 'path' | |
| import { nextTestSetup } from 'e2e-utils' | |
| import { retry } from 'next-test-utils' | |
| describe('get-logs MCP tool', () => { | |
| const { next, skipped } = nextTestSetup({ | |
| files: path.join(__dirname, 'fixtures', 'log-file-app'), | |
| }) | |
| if (skipped) { | |
| return | |
| } | |
| async function callGetLogs(id: string): Promise<string> { | |
| const response = await fetch(`${next.url}/_next/mcp`, { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| Accept: 'application/json, text/event-stream', | |
| }, | |
| body: JSON.stringify({ | |
| jsonrpc: '2.0', | |
| id, | |
| method: 'tools/call', | |
| params: { name: 'get_logs', arguments: {} }, | |
| }), | |
| }) | |
| const text = await response.text() | |
| const match = text.match(/data: ({.*})/s) | |
| const result = JSON.parse(match![1]) | |
| return result.result?.content?.[0]?.text | |
| } | |
| it('should return log file path via MCP get_logs tool', async () => { | |
| // Generate some logs by visiting pages that create log entries | |
| await next.browser('/server') | |
| await next.browser('/client') | |
| await next.browser('/pages-router-page') | |
| await retry(async () => { | |
| const sessionId = 'test-mcp-logs-' + Date.now() | |
| const responseText = await callGetLogs(sessionId) | |
| const response = JSON.parse(responseText) | |
| expect(response).toMatchObject({ | |
| logFilePath: expect.stringContaining('logs/next-development.log'), | |
| }) | |
| }) | |
| }) | |
| }) | |
Xet Storage Details
- Size:
- 1.48 kB
- Xet hash:
- 722ed4fe0537bacbb008ae04832b51289bf16896e867ca37ca12266e0531eddd
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.