function scanRedis (world, command, args) {
  return world.api.callMemoryStorage(command, args)
    .then(response => {
      if (response.error) {
        return Bluebird.reject(response.error);
      }

      if (world.memoryStorageResult === null) {
        world.memoryStorageResult = { result: response.result[1] };
      }
      else {
        world.memoryStorageResult.result.push(...response.result[1]);
      }

      // advance the cursor to its next position
      args.args.cursor = Number.parseInt(response.result[0]);

      return args.args.cursor === 0 ? world.memoryStorageResult : scanRedis(world, command, args);
    });
}
Executes on of the *scan family command, recursively, until
the scan completes

@param {object} world - functional tests global object
@param {string} command - name of the scan command (scan, hscan, sscan, zscan)
@param {object} args - scan arguments
@returns {Bluebird<object>}