diff --git a/packages/angular/plugins/component-testing.ts b/packages/angular/plugins/component-testing.ts index d43b2adf88..8db59a06b8 100644 --- a/packages/angular/plugins/component-testing.ts +++ b/packages/angular/plugins/component-testing.ts @@ -100,7 +100,7 @@ ${e.stack ? e.stack : e}` return { ...nxBaseCypressPreset(pathToConfig), // NOTE: cannot use a glob pattern since it will break cypress generated tsconfig. - specPattern: ['**/*.cy.ts', '**/*.cy.js'], + specPattern: ['src/**/*.cy.ts', 'src/**/*.cy.js'], devServer: { // cypress uses string union type, // need to use const to prevent typing to string diff --git a/packages/react/plugins/component-testing/index.ts b/packages/react/plugins/component-testing/index.ts index ad81554d95..1b7a29b0ae 100644 --- a/packages/react/plugins/component-testing/index.ts +++ b/packages/react/plugins/component-testing/index.ts @@ -93,6 +93,7 @@ export function nxComponentTestingPreset( } return { ...nxBaseCypressPreset(pathToConfig), + specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', devServer: { // cypress uses string union type, // need to use const to prevent typing to string