fix(tests): Fix tests and documentation: adjust test server routes and expectations, add timeout/fallback routes, and refresh README

This commit is contained in:
2025-10-20 13:41:03 +00:00
parent 54afcc46e2
commit c9c35169fc
6 changed files with 663 additions and 478 deletions

View File

@@ -16,7 +16,7 @@ tap.test('setup test server', async () => {
testServer.addRoute(
'/apiroute1',
new typedserver.servertools.Handler('GET', (req, res) => {
res.status(429);
res.status(500);
res.end();
}),
);
@@ -48,7 +48,6 @@ tap.test('should handle fallback URLs', async () => {
{
fallbackUrls: [
'http://localhost:2345/apiroute2',
'http://localhost:2345/apiroute4',
'http://localhost:2345/apiroute3',
],
retry: {
@@ -59,6 +58,8 @@ tap.test('should handle fallback URLs', async () => {
}
);
expect(response.ok).toEqual(true);
expect(response.status).toEqual(200);
const data = await response.json();
console.log('response with fallbacks: ' + JSON.stringify(data));
expect(data).toHaveProperty('hithere');