Skip to content

Commit

Permalink
Add a couple more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed May 25, 2022
1 parent f91adde commit 2ad06f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/unit/image-optimizer/match-remote-pattern.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ describe('matchRemotePattern', () => {
false
)
expect(m(p, new URL('https://example.com/team/pic.jpg'))).toBe(false)
expect(m(p, new URL('https://sub.example.com/act123/usr6/pic.jpg'))).toBe(
false
)
})

it('should match pathname pattern with double asterisk', () => {
Expand All @@ -287,6 +290,9 @@ describe('matchRemotePattern', () => {
expect(m(p, new URL('https://example.com/act123/team/pic.jpg'))).toBe(true)
expect(m(p, new URL('https://example.com/act456/team/pic.jpg'))).toBe(false)
expect(m(p, new URL('https://example.com/team/pic.jpg'))).toBe(false)
expect(m(p, new URL('https://sub.example.com/act123/team/pic.jpg'))).toBe(
false
)
})

it('should throw when hostname is missing', () => {
Expand Down

0 comments on commit 2ad06f9

Please sign in to comment.