Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caseycarroll committed Mar 8, 2024
1 parent f649570 commit 8d29c13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/vite/src/node/__tests__/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ describe('processSrcSetSync', () => {
)
})

test('should handle srcset when descriptor is not present', async () => {
const srcsetNoDescriptor = 'asset.png, test.png 400w,test2?param1=true.png'
const result = 'asset.png, test.png 400w, test2?param1=true.png'
expect(processSrcSetSync(srcsetNoDescriptor, ({ url }) => url)).toBe(result)
})

test('should not break a regular URL in srcSet', async () => {
const source = 'https://anydomain/image.jpg'
expect(
Expand Down

0 comments on commit 8d29c13

Please sign in to comment.