title: Working with global window variable in mocha js from node
body: <p>I am new to js unit testing and I am trying to use mocha for my backbone contact manager tutorial that i found at <a href="https://github.com/dmytroyarmak/backbone-contact-manager/blob/gh-pages/app/js/app.js">this github repo</a>. However, i have a global window.ContactManager variable that I firsted wanted to test whether it exists and then test the router.on functionality inside the start function later. The variable looks like so: </p>
  
  <pre><code>  window.ContactManager = {
    Models: {},
    Collections: {},
    Views: {},
  
    start: function(data) {
      var contacts = new ContactManager.Collections.Contacts(data.contacts),
          router = new ContactManager.Router();
  
      router.on('route:home', function() {
        router.navigate('contacts', {
          trigger: true,
          replace: true
        });
      });
  
      router.on('route:showContacts', function() {
        var contactsView = new ContactManager.Views.Contacts({
          collection: contacts
        });
  .....
  </code></pre>
  
  <p>My test that does not work: 
  var expect = require ('chai').expect;</p>
  
  <pre><code>describe("Application", function() {
      it('creates a global variable for the name space ContactManager' , function () {
          expect(ContactManager).to.exist;
      })
  });
  </code></pre>
  
  <p>How do I test and access a global window variable existence in mocha from running the tests in the console?</p>