From 30c3cac40d967ccbe228831f6ab30cc26f9c48e6 Mon Sep 17 00:00:00 2001 From: rishtigupta Date: Tue, 19 Nov 2024 13:25:37 -0800 Subject: [PATCH] feat: add http api tests to web sdk --- packages/client-sdk-web/package.json | 1 + .../test/integration/shared/http/http-api.test.ts | 7 +++++++ packages/common-integration-tests/src/http/http-apis.ts | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 packages/client-sdk-web/test/integration/shared/http/http-api.test.ts diff --git a/packages/client-sdk-web/package.json b/packages/client-sdk-web/package.json index 4ec70ab64..8ffd247c2 100644 --- a/packages/client-sdk-web/package.json +++ b/packages/client-sdk-web/package.json @@ -17,6 +17,7 @@ "test": "jest --testPathIgnorePatterns auth-client.test.ts --maxWorkers 1", "unit-test": "jest unit", "integration-test-auth": "jest --env=jsdom auth/ --maxWorkers 1 -- useConsistentReads", + "integration-test-http": "jest --env=jsdom http/ --maxWorkers 1 -- useConsistentReads", "integration-test-cache": "jest --env=jsdom cache/ --maxWorkers 1 -- useConsistentReads", "integration-test-control-cache-topics": "npm run integration-test-cache && npm run integration-test-topics", "integration-test-leaderboard": "jest --env=jsdom leaderboard/ --maxWorkers 1 -- useConsistentReads", diff --git a/packages/client-sdk-web/test/integration/shared/http/http-api.test.ts b/packages/client-sdk-web/test/integration/shared/http/http-api.test.ts new file mode 100644 index 000000000..bda6dd616 --- /dev/null +++ b/packages/client-sdk-web/test/integration/shared/http/http-api.test.ts @@ -0,0 +1,7 @@ +import {SetupAuthClientIntegrationTest} from '../../integration-setup'; +import {runHttpApiTest} from '@gomomento/common-integration-tests/dist/src/http/http-apis'; + +const {mgaAccountSessionTokenAuthClient, cacheName} = + SetupAuthClientIntegrationTest(); + +runHttpApiTest(mgaAccountSessionTokenAuthClient, cacheName); diff --git a/packages/common-integration-tests/src/http/http-apis.ts b/packages/common-integration-tests/src/http/http-apis.ts index d5643a2c1..74740b69e 100644 --- a/packages/common-integration-tests/src/http/http-apis.ts +++ b/packages/common-integration-tests/src/http/http-apis.ts @@ -205,7 +205,6 @@ export function runHttpApiTest( // Use DELETE API to delete the value that was set const delRes = await deleteValue(baseUrl, apiKey, cacheName, key); expect(delRes.statusCode).toBe(204); - console.log(delRes.statusMessage); }); it('should return success on DELETE on non-existing key', async () => {