From a842f6ab66cb2ae6024ea26675fe2e01407ab0b7 Mon Sep 17 00:00:00 2001 From: Marc Tobias Date: Mon, 26 Jun 2023 18:02:41 +0200 Subject: [PATCH] replace httpbin with beeceptor for mocking HTTP error codes --- test/api_errors.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/api_errors.js b/test/api_errors.js index 084159e..05b2b35 100644 --- a/test/api_errors.js +++ b/test/api_errors.js @@ -6,7 +6,7 @@ describe('Nominatim API errors', function () { describe('HTTP 503 - service unavailable', function () { before(async function () { page = await browser.newPage(); - await page.goto('http://localhost:9999/search.html?q=london&httpbin_status=503'); + await page.goto('http://localhost:9999/search.html?q=london&mock_http_status=503'); }); after(async function () { @@ -17,7 +17,7 @@ describe('Nominatim API errors', function () { await page.waitForSelector('#error'); let message = await page.$eval('#error', el => el.textContent); - assert.ok(message.includes('httpbin.org')); + assert.ok(message.includes('/status/503')); assert.ok(message.includes('Error fetching data from')); }); }); @@ -25,7 +25,7 @@ describe('Nominatim API errors', function () { describe('HTTP 200 - JSON parsing fails', function () { before(async function () { page = await browser.newPage(); - await page.goto('http://localhost:9999/search.html?q=london&httpbin_status=200'); + await page.goto('http://localhost:9999/search.html?q=london&mock_http_status=200'); }); after(async function () { @@ -36,7 +36,7 @@ describe('Nominatim API errors', function () { await page.waitForSelector('#error'); let message = await page.$eval('#error', el => el.textContent); - assert.ok(message.includes('httpbin.org')); + assert.ok(message.includes('/status/200')); assert.ok(message.includes('Error parsing JSON data from')); }); }); -- 2.39.5