title: Cypress - mocking window property
body: <p>I have a code that uses window.foo.abc as a condition to display something.</p>
  <p>I want to test this functionality with cypress and I want to mock this value to be false and true.</p>
  <p>How can I do that?</p>
  <p>I've tried</p>
  <pre><code> before(function() {
        Cypress.on('window:before:load', win =&gt; {
          win.foo.abc = true;
        });
  </code></pre>
  <p>and</p>
  <pre><code>  cy.window().then(win =&gt; {
      window.foo.abc = true;
    });
  </code></pre>
  <p>with no success.</p>
  <p>How can I mock this value?</p>
  <p>thanks </p>