fix(core): nxComponentTestingPreset should not expose bundler option (#23009)

This commit is contained in:
Nicholas Cunningham 2024-04-26 02:31:11 -06:00 committed by GitHub
parent ac9ad35754
commit 49af691b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { import {
nxBaseCypressPreset, nxBaseCypressPreset,
NxComponentTestingOptions, NxComponentTestingPresetOptions,
} from '@nx/cypress/plugins/cypress-preset'; } from '@nx/cypress/plugins/cypress-preset';
import { import {
createExecutorContext, createExecutorContext,
@ -45,7 +45,7 @@ import { gte } from 'semver';
*/ */
export function nxComponentTestingPreset( export function nxComponentTestingPreset(
pathToConfig: string, pathToConfig: string,
options?: NxComponentTestingOptions options?: NxComponentTestingPresetOptions
) { ) {
if (global.NX_GRAPH_CREATION) { if (global.NX_GRAPH_CREATION) {
// this is only used by plugins, so we don't need the component testing // this is only used by plugins, so we don't need the component testing

View File

@ -34,6 +34,11 @@ export interface NxComponentTestingOptions {
compiler?: 'swc' | 'babel'; compiler?: 'swc' | 'babel';
} }
// The bundler is only used while generating the component testing configuration
// It cannot be changed after the configuration is generated
export interface NxComponentTestingPresetOptions
extends Omit<NxComponentTestingOptions, 'bundler'> {}
export function nxBaseCypressPreset( export function nxBaseCypressPreset(
pathToConfig: string, pathToConfig: string,
options?: { testingType: 'component' | 'e2e' } options?: { testingType: 'component' | 'e2e' }