function signJWTHelper(payload, secretOrPrivateKey, options, callback) {
  // freeze the time to ensure the clock remains stable across the async and sync calls
  const fakeClock = sinon.useFakeTimers({now: Date.now()});
  let error;
  let syncSigned;
  try {
    syncSigned = jwt.sign(payload, secretOrPrivateKey, options);
  }
  catch (err) {
    error = err;
  }
  jwt.sign(payload, secretOrPrivateKey, options, (err, asyncSigned) => {
    fakeClock.restore();
    if (error) {
      expectEqualError(err, error);
      callback(err);
    }
    else {
      expect(syncSigned, 'Async/Sync token equality').to.equal(asyncSigned);
      callback(null, syncSigned);
    }
  });
}
Sign a payload to create a JWT, ensuring that the asynchronous and synchronous calls to `sign` have the same result
@param {object} payload The JWT payload
@param {string} secretOrPrivateKey The shared secret or private key
@param {object} options Sign options
@param {function(err, token):void} callback