Jest testing, sessionStorage undefined
<p>I am trying to run my first Jest test but I get this error</p>

<pre><code> FAIL  src\containers\__test__\AppContainer.spec.js
  ● Test suite failed to run

    ReferenceError: sessionStorage is not defined
</code></pre>

<p>I'm not sure if I should be even getting this error as I am not testing sessionStorage, just want to test the root container.</p>

<p>--update--</p>

<pre><code>import React from 'react'
import { shallow } from 'enzyme'
import AppContainer from '../AppContainer'

//Tried here also
global.sessionStorage = {
  data: {},
  setItem: (key, value) =&gt; {
    this.data[key] = value
  },
  getItem: (key) =&gt; this.data[key]
}
describe('AppContainer', () =&gt; {
  beforeEach(function () {
    global.sessionStorage = {
      data: {},
      setItem: (key, value) =&gt; {
        this.data[key] = value
      },
      getItem: (key) =&gt; this.data[key]
    }
  })

  it('should render self and subcomponents', () =&gt; {
    const enzymeWrapper = shallow(&lt;AppContainer /&gt;)

    expect(enzymeWrapper.find('div').hasClass('grommetux-app')).toBe(true)
  })
})
</code></pre>

<p>--</p>

<pre><code>ReferenceError: sessionStorage is not defined
  at Function.r.get (node_modules\oidc-client\lib\oidc-client.min.js:1:13009)
  at new e (node_modules\oidc-client\lib\oidc-client.min.js:74:15382)
  at new e (node_modules\oidc-client\lib\oidc-client.min.js:74:5255)
  at n (node_modules\redux-oidc\dist\redux-oidc.js:1:1853)
  **at Object.&lt;anonymous&gt; (src\utils\userManager.js:23:127)**
  at Object.&lt;anonymous&gt; (src\containers\AppContainer.js:9:46)
  at Object.&lt;anonymous&gt; (src\containers\__test__\AppContainer.spec.js:3:47)
  at process._tickCallback (internal\process\next_tick.js:103:7)
</code></pre>

<p>I am "using" sessionStorage via a library, <a href="https://github.com/IdentityModel/oidc-client-js" rel="nofollow noreferrer">oidc-clientjs</a>, so I really don't have control over it. </p>

<p>Line 23 that it is the source of the error is</p>

<pre><code>import { createUserManager } from 'redux-oidc'
....
const userManager = createUserManager(config) (L23)
</code></pre>