title: Type Error: cannot read property ' map ' of undefined
body: <p>I am try to run an unit test for the following code
  here is where the error is pointing to:  </p>
  
  <pre><code>populateActionDropdown = (actionList) =&gt; {
      let actions = actionList.map(action =&gt; {
          if (action.Name != 'Sign Out') {
              let layout = ''
              if (action.Command.includes('Layout')) {
                  if (/\(([^)]+)\)/.exec(action.Command)) {
                      layout = '/' + /\(([^)]+)\)/.exec(action.Command)[1].toLowerCase();
                  }
              }
  </code></pre>
  
  <p>This is how I have been setting up most of my unit test. But I'm having problems calling props that contains map or sort next to it.
  Example : this.props.something.map() or props.sort().
  How could i mock actionList to make sure map gets called</p>
  
  <p>Thanks</p>
  
  <p>Unit test code below :</p>
  
  <pre><code>describe('ActionMenu ', () =&gt; {
  
      let tree;
      let baseProps;
      let mockaction = {
          actionId: "test",
          name: "test",
          map: "test",
      };
      let mocksetTarget;
      let mocksetAction;
      let mockmodule = {
          name: "test module name",
      };
      let mockactionMenuDropdownOpen;
      let mockactionMenuToggle;
      let mockactionList;
  
      beforeEach(() =&gt; {
          baseProps = {
              action: mockaction,
              setTarget: mocksetTarget,
              setAction: mocksetAction,
              module: mockmodule,
              actionMenuDropdownOpen: mockactionMenuDropdownOpen,
              actionMenuToggle: mockactionMenuToggle,
              actionList: mockactionList,
          }
      })
  
      it(' Should render with all of the props', () =&gt; {
          tree = renderer.create(&lt;BrowserRouter&gt;&lt;ActionMenuComponent {...baseProps}
          /&gt;
          &lt;/BrowserRouter&gt;)
          let treeJson = tree.toJSON()
          expect(treeJson).toMatchSnapshot();
          tree.unmount()
      });
  });
  </code></pre>