From cf46ef5e798a4f89212ff6e2742ea84fdccc6be6 Mon Sep 17 00:00:00 2001 From: einaralex Date: Mon, 13 Jan 2025 13:01:46 +0000 Subject: [PATCH] fix: add prod test and join pull request together --- packages/sdk/test/client-apimock.test.ts | 36 +++++++++++++++++++++++- release-please-config.json | 1 - 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/packages/sdk/test/client-apimock.test.ts b/packages/sdk/test/client-apimock.test.ts index 02f8e2dd..1bd826fe 100644 --- a/packages/sdk/test/client-apimock.test.ts +++ b/packages/sdk/test/client-apimock.test.ts @@ -28,7 +28,41 @@ const clientId = 'testClientId'; const redirectUri = 'http://example.com'; let client: MoneriumClient; -describe('MoneriumClient', () => { +describe.only('MoneriumClient - production', () => { + beforeAll(() => { + Object.defineProperty(window, 'location', { + value: { + assign: assignMock, + }, + writable: true, + }); + }); + afterEach(() => { + window.localStorage.clear(); + jest.restoreAllMocks(); + assignMock.mockRestore(); + }); + test('get tokens', async () => { + const client = new MoneriumClient({ + environment: 'production', + clientId, + redirectUri, + }); + await client.getTokens().catch(() => ({})); + + expect(fetchMock?.mock?.calls?.length).toEqual(1); + + expect(fetchMock?.mock?.calls?.[0]?.[0]).toEqual( + `https://api.monerium.app/tokens` + ); + expect(fetchMock?.mock?.calls?.[0]?.[1]).toEqual( + expect.objectContaining({ + method: 'GET', + }) + ); + }); +}); +describe('MoneriumClient - sandbox', () => { beforeAll(() => { Object.defineProperty(window, 'location', { value: { diff --git a/release-please-config.json b/release-please-config.json index 152c3582..7307d8f2 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,7 +1,6 @@ { "pull-request-title-pattern": "Release ${component} ${version} :rocket:", "pull-request-header": ":robot: I have created a release *beep* *boop*", - "separate-pull-requests": true, "changelog-sections": [ { "type": "feat", "section": "Features", "hidden": false }, { "type": "fix", "section": "Bug Fixes", "hidden": false },