Jest giving Timeout error on PhPUnserialize unserialize method

I am using Jest as Test runner in express code base . I am receiving an error when running one test case . Its throwing error at PHPUnserialize line . I am not understanding how to solve this issue as I have tried modifying timeouts but no of no avail.

Test Case

  it("Returns data from cache", async () => {
    //perform the request to the api which will now be intercepted by nock
    const res = await request(app).get(
    //assert that the mocked response is returned


  at Console.log (node_modules/winston/lib/winston/transports/console.js:79:23)

      Error: Uncaught [TypeError: PHPUnserialize.unserialize is not a function]
          at reportException (/Users/anandabhishe/gitlab/wellness/wellbeing-proxy/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:62:24)
          at Timeout.task [as _onTimeout] (/Users/anandabhishe/gitlab/wellness/wellbeing-proxy/node_modules/jsdom/lib/jsdom/browser/Window.js:396:9)
          at listOnTimeout (internal/timers.js:554:17)
          at processTimers (internal/timers.js:497:7) TypeError: PHPUnserialize.unserialize is not a function
          at apply (/Users/anandabhishe/gitlab/wellness/wellbeing-proxy/routes/drupal.js:39:37)
          at tryCatcher (/Users/anandabhishe/gitlab/wellness/wellbeing-proxy/node_modules/standard-as-callback/built/utils.js:11:23)
          at /Users/anandabhishe/gitlab/wellness/wellbeing-proxy/node_modules/standard-as-callback/built/index.js:19:23
          at processTicksAndRejections (internal/process/task_queues.js:93:5)

Piece of code under test

function cache(req, res, next) {
  const url = req.url;
  var pos = url.indexOf("?");
  var type = req.private == true ? "?type=private" : "?type=public";
  var cachekey = cacheKeyPrefix.concat(url.slice(4, pos)).concat(type);"<<<< Cache Key >>>>", cachekey);
  client.hgetall(cachekey, (err, data) => {
    if (err) {
      if (err instanceof Redis.ReplyError) {"<<<< Redis Reply Error >>>>", err.message);
          error_description: err.message,
      } else {"<<<< Redis Connection Error >>>>", err.message);
        req.redisErr = true;
        return next(err);
    if (Object.keys(data).length !== 0 && data !== null) {"<<<< Found in Cache >>>>", typeof data);
      var datasend = PHPUnserialize.unserialize('a:0:{}');
    } else {"<<<< Not Found in Cache >>>>");