const { callTool, parseToolResponse, ensureServer } = require('../helpers');
describe('get_video_comments', () => {
beforeAll(async () => {
if (!process.env.BYPASS_AUTH_FOR_TESTS) {
throw new Error('BYPASS_AUTH_FOR_TESTS is not set. Set it in your .env to run tests.');
}
await ensureServer();
}, 60000);
for (const sortBy of ['TOP_COMMENTS', 'NEWEST_FIRST']) {
for (const includeReplies of [true, false]) {
for (const maxResults of [1, 20, 100]) {
test(`returns comments (sortBy=${sortBy}, includeReplies=${includeReplies}, maxResults=${maxResults})`, async () => {
const resp = await callTool('get_video_comments', { videoId: 'dQw4w9WgXcQ', sortBy, maxResults, includeReplies });
const arr = parseToolResponse(resp, 'get_video_comments');
expect(Array.isArray(arr)).toBe(true);
}, 60000);
}
}
}
});