const { callTool, ensureServer } = require('../helpers');
describe('get_trending_videos', () => {
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 limit of [1, 10, 50]) {
test(`returns array (limit=${limit})`, async () => {
const resp = await callTool('get_trending_videos', { limit });
if (resp.error) throw new Error(resp.error.message);
const arr = JSON.parse(resp.result?.content?.[0]?.text || 'null');
expect(Array.isArray(arr)).toBe(true);
}, 60000);
}
});