-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(utils): support star matching (#84)
* fix(utils): support star matching support star matching in domain and path in regex * chore: add missing explicit type --------- Co-authored-by: Peter Weller <[email protected]>
- Loading branch information
1 parent
18880eb
commit a476b79
Showing
4 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,7 @@ yarn-error.log | |
# eslint | ||
.eslintcache | ||
|
||
# ide | ||
.idea | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,4 +120,25 @@ test.describe.parallel('HTTP example: users list', () => { | |
await page.goto('/users/testmytestface'); | ||
await expect(page.locator('text="[email protected]"')).toBeVisible(); | ||
}); | ||
|
||
test('should allow paths with route with `*` to be mocked', async ({ | ||
page, | ||
worker, | ||
}) => { | ||
await worker.use( | ||
http.get('/a*i/us*/:userId', () => | ||
HttpResponse.json({ | ||
id: 'testmytestface', | ||
firstName: 'Testy', | ||
lastName: 'Mctestface', | ||
dob: '1969-6-9', | ||
email: '[email protected]', | ||
address: '111 Testy Way', | ||
phoneNumber: '(123) 456-7890', | ||
}), | ||
), | ||
); | ||
await page.goto('/users/testmytestface'); | ||
await expect(page.locator('text="[email protected]"')).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters