Skip to content

Commit

Permalink
fix: add prod test and join pull request together
Browse files Browse the repository at this point in the history
  • Loading branch information
einaralex committed Jan 13, 2025
1 parent b7a1b8e commit cf46ef5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
36 changes: 35 additions & 1 deletion packages/sdk/test/client-apimock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
1 change: 0 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
@@ -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 },
Expand Down

0 comments on commit cf46ef5

Please sign in to comment.