title: Fetch-Mock Error. No fallback response defined for POST
body: <p>I need to test an asynchronous function (redux thunk) in jest. To do this, I decided to use fetchMock. But I'm having problems. The test ends successfully but I get an error from fetch</p>
  
  <pre><code>'fetch-mock: No fallback response defined for POST to http:// *Link* /tmo/rest/user'
  </code></pre>
  
  <p>Testing block in jest:</p>
  
  <pre><code>it('test: AuthMethod', async () =&gt; {
      fetchMock.mock(Link, 200);
      fetchMock.getOnce('/tmo/rest/user', {
        body: JSON.stringify(body),
        method: 'POST',
        headers: header,
      });
  
      store.dispatch(AuthMethod()).then(() =&gt; {
        let expectedActions = [
          {
            type: FETCH_AUTH_SUCCESS,
            payload: data,
          },
        ];
        expect(store.getActions()).toEqual(expectedActions);
      });
  
      let value = store.getState();
      console.log(value);
    });
  </code></pre>
  
  <p>Fetch-Mock Elements: </p>
  
  <p>body: </p>
  
  <pre><code>const body = {
    login: login,
    password: password,
    deviceSerialNumber: '1111111',
    currentAppVersion: AppVersion,
    currentDateTime: time,
  };
  </code></pre>
  
  <p>headers: </p>
  
  <pre><code>const header = {
    Accept: 'application/json',
    'Content-Type': 'application/json',
  };
  </code></pre>