diff --git a/docs/shared/packages/cypress/cypress-setup-node-events.md b/docs/shared/packages/cypress/cypress-setup-node-events.md index a6f0d9750c701e..040b7ed0bd3726 100644 --- a/docs/shared/packages/cypress/cypress-setup-node-events.md +++ b/docs/shared/packages/cypress/cypress-setup-node-events.md @@ -20,7 +20,7 @@ The Cypress preset that Nx provides (`@nx/cypress/plugins/cypress-preset`) uses import { defineConfig } from 'cypress'; import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; -const config = nxE2EPreset(__filename, { +const preset = nxE2EPreset(__filename, { cypressDir: 'src', bundler: 'vite', webServerCommands: { @@ -32,10 +32,10 @@ const config = nxE2EPreset(__filename, { export default defineConfig({ e2e: { - ...config, + ...preset, async setupNodeEvents(on, config) { // This line sets up the web server as provided via `webServerCommands` and `ciWebServerCommand` - await config.setupNodeEvents(on, config); + await nxConfig.setupNodeEvents(on, config); // Register your listeners here },