code: function(pageName, captureIndex, viewportName) {
        if (typeof data[pageName] !== 'object') self.catchErrors('Page ' + pageName + ' is missing from your configuration file. You can\'t compareToPage without it. Available pages: ' + Object.keys(data).join(', '));
        if (typeof viewportsData[viewportName] !== 'object') self.catchErrors('Viewport ' + viewportName + ' is missing from your configuration file. You can\'t compareToViewport without it. Available viewports: ' + Object.keys(viewportsData).join(', '));
        if (typeof data[pageName].captures[captureIndex] != 'object') throw('Capture "' + captureIndex + '" is missing from your configuration page named "' + pageName +'"/ Your captures must be present on both sides when compareToPage is used.');
        // Available in setFileName:
        var captureState = data[pageName].captures[captureIndex];
        captureState.page = {};
        for (var prop in data[pageName]) {
          if (prop != 'captures') {
            captureState.page[prop] = data[pageName][prop];
          }
        }
        captureState.viewport = viewportsData[viewportName];
        captureState.options = options;
        captureState.count = SuccssCount;
        // Available in the after capture callback:
        captureState.file = self.setFileName(captureState);
        captureState.filePath = captureState.page.directory.replace(/\/$/, '') + '/' + captureState.file;
        captureState.action = captureState.options.action;
        return captureState;
      }
docs: Creates the capture state object used for taking screenshots, naming screenshots (Succss.setFileName),
  hooking after capture (Succss.callback), then while diffing (Succss.diff | Succss.imagediff | Succss.resemble).
  
  @param {String} pageName
  @param {Number} captureIndex
  @param {String} viewportName
  @returns {Object} capture state