Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.0 Release #430

Merged
merged 9 commits into from Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/commands/network-requests.html
Expand Up @@ -93,8 +93,8 @@ <h4 id="server"><a href="https://on.cypress.io/server">cy.server()</a></h4>
expect(server.enable).to.be.true
// forces requests that don't match your routes to 404
expect(server.force404).to.be.false
// whitelists requests from ever being logged or stubbed
expect(server.whitelist).to.be.a('function')
// ignores requests from ever being logged or stubbed
expect(server.ignore).to.be.a('function')
})

cy.server({
Expand Down
6 changes: 3 additions & 3 deletions app/cypress-api.html
Expand Up @@ -120,7 +120,7 @@ <h4 id="Cookies.preserveOnce"><a href="https://on.cypress.io/cookies">Cypress.Co
<h4 id="Cookies.default"><a href="https://on.cypress.io/cookies">Cypress.Cookies.default()</a></h4>
<p>To set defaults for all cookies, use <a href="https://on.cypress.io/cookies"><code>Cypress.Cookies.default()</code></a>.</p>
<pre><code class="javascript">Cypress.Cookies.defaults({
whitelist: 'session_id'
preserve: 'session_id'
})</code></pre>
</div>

Expand All @@ -132,8 +132,8 @@ <h4 id="Server.default"><a href="https://on.cypress.io/cypress-server">Cypress.S
<pre><code class="javascript">Cypress.Server.defaults({
delay: 0,
force404: true,
whitelist: function(xhr){
// handle custom logic for whitelisting
ignore: function(xhr){
// handle custom logic for ignoring XHRs
}
})</code></pre>
</div>
Expand Down
5 changes: 4 additions & 1 deletion cypress/integration/examples/cypress_api.spec.js
Expand Up @@ -65,10 +65,13 @@ context('Cypress.Cookies', () => {
})

it('.defaults() - set defaults for all cookies', () => {
if (Number(Cypress.version.charAt(0)) < 5) return

// now any cookie with the name 'session_id' will
// not be cleared before each new test runs
Cypress.Cookies.defaults({
whitelist: 'session_id',
// @ts-ignore
preserve: 'session_id',
})
})
})
Expand Down
8 changes: 6 additions & 2 deletions cypress/integration/examples/network_requests.spec.js
Expand Up @@ -29,8 +29,12 @@ context('Network Requests', () => {
expect(server.enable).to.be.true
// forces requests that don't match your routes to 404
expect(server.force404).to.be.false
// whitelists requests from ever being logged or stubbed
expect(server.whitelist).to.be.a('function')

if (Number(Cypress.version.charAt(0)) >= 5) {
// ignores requests from ever being logged or stubbed
// @ts-ignore
expect(server.ignore).to.be.a('function')
}
})

cy.server({
Expand Down
19 changes: 14 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.