title: Why branch is not covered with rest parameters in Jest?
body: <p>I'm currently trying to cover 100% of my function but I'm facing a branch not covered and it don't understand why it's not covered and even how to fix and cover it. </p>
  
  <p><a href="https://i.stack.imgur.com/zZapH.png" rel="noreferrer">test coverage result here</a></p>
  
  <p>It tried many different tests but it didn't changed anything. I don't if the problems comes from me or Jest ?</p>
  
  <p><strong>My function</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>export const removeProductInList = (state: IItems, action: IBasketRemoveProductAction) =&gt; {
      const {
          payload: { uuid },
      } = action;
      const { [uuid]: itemToRemove, ...restOfItems } = state;
      return restOfItems;
  };
  </code></pre>
  
  <p><strong>My tests</strong></p>
  
  <pre><code>product1 = { id: 1 };
  product2 = { id: 2 };
  mockUuid1 = 'IdTest';
  mockUuid2 = 'IdTest2';
  mockItem1 = { product: product1, quantity: 1 };
  mockItem2 = { product: product2, quantity: 1 };
  mockListItems = {
        [mockUuid1]: mockItem1,
        [mockUuid2]: mockItem2,
  };
  
  it('should handle PRODUCT__REMOVE', () =&gt; {
          expect(removeProductInList({ [mockUuid1]: mockItem1 }, removeProduct(mockUuid1))).toEqual({});
  
          expect(removeProductInList(mockListItems, removeProduct(mockUuid1))).toEqual({ [mockUuid2]: mockItem2 });
  
          expect(removeProductInList({}, removeProduct('acac'))).toEqual({});
      });
  </code></pre>
  
  <p>I expect to cover all the function with my actual test.</p>
  
  <p>My version of jest is <code>23.4.1</code>, just in case.</p>