Skip to content

Commit

Permalink
test: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Oct 14, 2024
1 parent 52a5cb7 commit 05d3f77
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/utils/__tests__/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ describe('getSiteByHost', () => {
{
sourceUrl: 'https://sourceurl.com/site1',
hostUrl: 'https://site1.com',
slug: 'site1',
locale: 'en',
},
{
sourceUrl: 'https://sourceurl.com/site2',
host: 'site2.com',
hostUrl: 'https://site2.com',
locale: 'es',
slug: 'site2',
},
],
};
Expand Down Expand Up @@ -179,4 +181,9 @@ describe('getSiteByHost', () => {
expect(getSiteByHost('site2.com', 'en')).toBeNull();
expect(getSiteByHost('site1.com', 'es')).toBeNull();
});

it('find sites by slug', () => {
expect(getSiteByHost('site1', 'en')?.sourceUrl).toBe('https://sourceurl.com/site1');
expect(getSiteByHost('site2', 'es')?.sourceUrl).toBe('https://sourceurl.com/site2');
});
});

0 comments on commit 05d3f77

Please sign in to comment.