mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-19 14:49:43 -05:00
989 B
989 B
title: api-server comments: true
Any configuration you pass to cy.server will only persist until the end of the test. If you find yourself passing the same configuration to each cy.server, then you might want to permanently change the default options for all cy.server instances.
Cypress.Server.defaults( object )
Change default configuration for cy.server
{% note info %}
A great place to put this configuration is in your cypress/support/defaults.js file, since it is loaded before any test files are evaluated.
{% endnote %}
Usage
// pass anything here you'd normally pass
// to cy.server(). These options will be the new defaults.
Cypress.Server.defaults({
delay: 500,
force404: false,
whitelist: function(xhr){
// handle custom logic for whitelisting
}
})