mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-31 20:09:01 -06:00
* fix: update the monorepo to typescript 5 * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * chore: updating v8 snapshot cache * run ci to see problems [run ci] * update vue-tsc and typings that conflict with update * regen snapshot * fix typescript errors ui test as stack trace behavior has changed * fix server unit tests * update cy.origin() spec based on stack traces and code frames * update spec to include source map url * run ci * fix check-ts * chore: fix system tests [run ci] * add preprocessor tests to batteries included to exercise new logic * run ci * refactor unit tests to be a bit more dry * pin typescript to ~5.4 and adjust config to ignroe deprecations but keep importsNotUsedAsValues * add changelog entry * add fixme issue to stack trace mismatches inside evaled context * use import type webpack as webpack as a lib isn't actually invboked in the runner webpack config * fix system test as adding 4 lines of comments impacts the stack trace line 4 lines (duh) --------- Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
proxy
This package contains the code for Cypress's HTTP interception proxy.
HTTP interception
./lib/http contains the code that intercepts HTTP requests. The bulk of the proxy's behavior is in three files:
request-middleware.tscontains code that manipulates HTTP requests from the browserresponse-middleware.tscontains code that manipulates HTTP responses to the browsererror-middleware.tshandles errors that occur in the request/response cycle
Building
Note: you should not ever need to build the .js files manually. @packages/ts provides require-time transpilation when in development.
yarn workspace @packages/proxy build-prod
Testing
Tests are located in ./test
To run tests:
yarn workspace @packages/proxy test
Additionally, the server package contains tests that use the proxy.
Debug Logs
High level logs are available in the DEBUG=cypress:proxy:* namespace.
Detailed per-request logs are available in DEBUG=cypress-verbose:proxy:http.