class Response {
  constructor(json) {
    this.json = json;
  }

  json() {
    return Promise.resolve(this.json);
  }
}

const fetch = jest.fn();

fetch.mockReturnValue(Promise.resolve(new Response({ response_code: 0 })));

fetch.setMockResponseJSON = (json) => {
  fetch.mockReturnValue(Promise.resolve(new Response(json)));
};

module.exports = fetch;

@@ -45,16 +45,20 @@
 his.json
+Data
  = json;
@@ -110,16 +110,20 @@
 his.json
+Data
 );%0A  %7D%0A%7D

Fix tests 🤦