Function setStorybookFiles

  • Get storybook files recursively, then make them available at Cypress.env("storybookFiles"). Put this in setupNodeEvents if either opting for the mountTest style of tests or if you want to maintain the option of switching to isolated component files.

    Drop in to setupNodeEvents for component tests in cypress.config.ts If this is the only thing you're doing there, could look like setupNodeEvents: setStorybookFiles. Otherwise:

    setupNodeEvents: (on, config) => {
    on.task({...});
    setStorybookFiles(on, config, optionalStoryPattern);
    return config; // be sure to return config
    },

    Parameters

    • on: PluginEvents
    • config: PluginConfigOptions
    • Optional storyPattern: string | RegExp

    Returns PluginConfigOptions