Skip to content

Commit

Permalink
docs(cypress): fix code snippet in cypress-setup-node-events.md
Browse files Browse the repository at this point in the history
This fixes an example. The outer config variable was shadowed, so this example would fail. By changing the outer variable name, this works
  • Loading branch information
chabb authored and U812320 committed Apr 24, 2024
1 parent 526ea7c commit 2736fd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/shared/packages/cypress/cypress-setup-node-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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
},
Expand Down

0 comments on commit 2736fd1

Please sign in to comment.