-
-
Notifications
You must be signed in to change notification settings - Fork 751
Closed
Description
What are you trying to achieve?
I try to overrides headers for specific routes.
I know I.haveRequestHeaders()
is working but on all routes, i need to overrides only specific routes that match RegExp
// Works on all routes
I.haveRequestHeaders({ 'X-Custom-Header': 'My-custom-Value' });
// Doesn't works
I.mockRoute(/\/api\//i, async (route: Route) => {
const existingHeaders = await route.request().allHeaders();
const headers = {
...existingHeaders,
'X-Custom-Header': 'My-custom-Value',
};
route.continue({ headers });
});
// Headers are not modified
Details
- CodeceptJS version: "codeceptjs": "^3.3.0",
- NodeJS Version: v16.9.1
- Playwright: "playwright": "^1.20.2"
Metadata
Metadata
Assignees
Labels
No labels