Cypress Image Diff Documentation
  • Migrate from v1 to v2
  • Getting started
    • Cypress integration
      • Typescript
      • Javascript
      • Browserstack
      • Cypress < v10
    • cy.compareSnapshot command
    • Custom config file
      • ROOT_DIR
      • FAILURE_THRESHOLD
      • RETRY_OPTIONS
      • FAIL_ON_MISSING_BASELINE
      • COMPARISON_OPTIONS
      • JSON_REPORT
      • CYPRESS_SCREENSHOT_OPTIONS
      • REPORT_DIR
      • SCREENSHOTS_DIR
      • NAME_TEMPLATE
    • Reporting
      • JSON report
      • Cypress Image Diff HTML Report
      • Legacy HTML Report
    • Client options
    • Running tests
    • Contributing
    • Publishing
Powered by GitBook
On this page
  1. Getting started
  2. Custom config file

COMPARISON_OPTIONS

PreviousFAIL_ON_MISSING_BASELINENextJSON_REPORT

Last updated 1 year ago

Custom options passed to pixelmatch, default to { threshold: 0.1 }. Please note that the COMPARISON_OPTIONS.threshold is different from the FAILURE_THRESHOLD

  • COMPARISON_OPTIONS.threshold: is the failure threshold for every pixel comparison

  • FAILURE_THRESHOLD: is the failure threshold for the whole comparison

💢 Default value: { threshold: 0.1 }

// cypress-image-diff.config.js
const config = {
  COMPARISON_OPTIONS: { threshold: 0.2 },
};

module.exports = config;

You can verify all available and updated options here:

pixelmatch options