We will make two improvements to support runner specific configuration.

1. cypress.json upgrades

Add support for runner specific overrides in cypress.json. Like this:

// cypress.json
{
    // defaults
    video: true,

    // added this e2e key
	  e2e: {
	    video: false // override!
	  },

    // added component
    component: { 
      viewportWidth: 500 // video is true - inherited.
    }
}

2. pass mode flag to plugins

Check if mode (either e2e or component) is already available in config. If not, add a third argument, mode.

// cypress/plugins/index.js
// adding third argument, mode. It can be either `component` or `e2e`.
module.exports = (on, { testingType, ...rest }) => {
  if (testingType === 'component') {
    // start webpack-dev-server, etc.
  }

  if (testingType === 'e2e') {
    // e2e things
  }

  // this is how plugins work already. You need to return a config file.
  return {...rest}
}

3. Make mode available in browser (optional)

This is optional, not required for 7.0. Good to have if it's easy or along the way, though.