Skip to content

Commit

Permalink
test: add tests for endpoints parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Dec 2, 2024
1 parent fa12f60 commit 6df5699
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,36 @@ describe('client', () => {
'https://custom.backend.com/api/v2'
);
});
it('works with staging backend url', () => {
const customClient = memori('https://backend-staging.memori.ai/api/v2');
expect(customClient.constants.BACKEND_URL).toBe(
'https://backend-staging.memori.ai/api/v2'
);
expect(customClient.constants.ENGINE_URL).toBe(
'https://engine-staging.memori.ai/memori/v2'
);
});
it('works with staging engine url', () => {
const customClient = memori(
undefined,
'https://engine-staging.memori.ai/memori/v2'
);
expect(customClient.constants.ENGINE_URL).toBe(
'https://engine-staging.memori.ai/memori/v2'
);
});
it('works with staging endpoints url', () => {
const customClient = memori(
'https://backend-staging.memori.ai/api/v2',
'https://engine-staging.memori.ai/memori/v2'
);
expect(customClient.constants.ENGINE_URL).toBe(
'https://engine-staging.memori.ai/memori/v2'
);
expect(customClient.constants.BACKEND_URL).toBe(
'https://backend-staging.memori.ai/api/v2'
);
});
it('works with custom engine url', () => {
const customClient = memori(
undefined,
Expand All @@ -28,6 +58,18 @@ describe('client', () => {
'https://custom.engine.com/memori/v2'
);
});
it('works with custom endpoints url', () => {
const customClient = memori(
'https://custom.backend.com/api/v2',
'https://custom.engine.com/memori/v2'
);
expect(customClient.constants.ENGINE_URL).toBe(
'https://custom.engine.com/memori/v2'
);
expect(customClient.constants.BACKEND_URL).toBe(
'https://custom.backend.com/api/v2'
);
});

it('works', async () => {
expect(
Expand Down

0 comments on commit 6df5699

Please sign in to comment.