title: TypeError: Cannot read property 'navigator' of undefined
body: <p>My unit test case started failing when I started running the unit test in mocha from karma,
  Earlier we were using karma and --browser to run the test case but it was running fine,</p>
  <pre><code>  1) common/browser-detection
         returns the mock object when there is no userAgent:
       TypeError: Cannot read property 'navigator' of undefined
        at Context.&lt;anonymous&gt; (packages/node_modules/@webex/plugin-meetings/test/unit/spec/common/browser-detection.js:115:41)
        at processImmediate (internal/timers.js:464:21)
  
    2) plugin-meetings
         meeting index
           Public Api Contract
             #addMedia
               should reject promise if user already in left state:
       AssertionError: expected [ReferenceError: navigator is not defined] to be an instance of UserNotJoinedError
        at /Users/nswarnka/Documents/Neeraj/Projects/upstream/webex-js-sdk/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js:763:20
  </code></pre>
  <p>Package.json</p>
  <pre><code>&quot;test&quot;: &quot;node ./tooling/index.js test&quot;,
  
   &quot;circleci:local&quot;: &quot;circleci local execute -c .circleci/github.config.yml&quot;,
  </code></pre>
  <p>test file -</p>
  <p>It fails for navigator here, TypeError: Cannot read property 'navigator' of undefined</p>
  <pre><code>  it('returns the mock object when there is no userAgent', () =&gt; {
      Object.defineProperty(global.window.navigator, 'userAgent', {
        get: () =&gt; undefined,
        configurable: true
      });
  </code></pre>
  <p>ReferenceError: navigator is not defined</p>
  <pre><code>/**
   * proxy to browser navigator.mediaDevices.enumerateDevices()
   * @returns {Promise}
   */
  Media.getDevices = () =&gt; {
    if (navigator &amp;&amp; navigator.mediaDevices &amp;&amp; navigator.mediaDevices.enumerateDevices) {
      return navigator.mediaDevices.enumerateDevices();
    }
  
    return Promise.reject(new MediaError('enumerateDevices not supported.'));
  };
  </code></pre>