# code-block-pro/1.1.0/cypress/support/globals.js

Code Block Pro – Beautiful Syntax Highlighting, version 1.1.0. 26 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.1.0/code/cypress/support/globals.js
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.1.0/raw/cypress/support/globals.js
- Modified: 2022-08-22T22:25:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.1.0/code/cypress/support/globals.js#L10-L20`.

```javascript
// Preserve WP cookies
Cypress.Cookies.defaults({
    preserve: /wordpress/,
});

// Make sure no errors
Cypress.on('window:before:load', (win) => {
    cy.spy(win.console, 'error');
});
afterEach(() => {
    cy.window().then((win) => {
        expect(win.console.error).to.have.callCount(0);
    });
});

beforeEach(() => {
    cy.loginUser();
    cy.visitNewPageEditor();
});

afterEach(() => {
    cy.saveDraft(); // so we can leave without an alert
    // cy.uninstallPlugin('rust-starter')
    cy.logoutUser();
});

```
