Skip to content

Commit

Permalink
Add test for relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed May 18, 2022
1 parent f39521d commit 652a78b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/astro-imagetools/api/utils/getSrcPath.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ describe('getLinkElement', () => {
const result = getSrcPath('https://cdn.nedis.com/images/products_high_res/TVRC2080BK_P30.JPG');
expect(result).toBe('https://cdn.nedis.com/images/products_high_res/TVRC2080BK_P30.JPG');
})

it('finds relative paths correctly', () => {
const outResult = getSrcPath('./out/out.jpeg');
const rootResult = getSrcPath('./root.jpeg');
expect(outResult).toBe(buildPath('out/out.jpeg'));
expect(rootResult).toBe(buildPath('root.jpeg'));
})
})

0 comments on commit 652a78b

Please sign in to comment.