Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AutoStubGlobalConfig

Here you will find the reference documentation for any globally configurable options.

These settings must be passed in to autoStubSetup in cypress/plugins/index.js

module.exports = (on, config) => {

     autoStubSetup(on, {
         mockFileDirectory: 'cypress/fixtures'
     })
}

Hierarchy

  • AutoStubGlobalConfig

Index

Properties

Optional forceRecord

forceRecord: undefined | false | true

If true we will begin overwriting any existing mock files for the current spec+test

Optional mockFileDirectory

mockFileDirectory: undefined | string

The directory where mock files should be written relative to project root

Optional whitelist

whitelist: Whitelist

Exactly the same as cypress cy.server whitelist function. Allows users to build a whitelist per request at a global level.

A whitelist in this context does not get stubbed/recorded by cy.route

Use this to keep your mock files smaller by whitelisting non essential requests like translations, and other static assets

autoStubSetup(on, {
   whitelist: (xhr => {
       if (xhr.url.includes('static')) {
           return true;
       }
   })

})

Generated using TypeDoc