UNPKG

@nx/cypress

Version:

The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.

81 lines 2.49 kB
import type { InlineConfig } from 'vite'; interface BaseCypressPreset { videosFolder: string; screenshotsFolder: string; chromeWebSecurity: boolean; } export interface NxComponentTestingOptions { /** * the component testing target name. * this is only when customized away from the default value of `component-test` * @example 'component-test' */ ctTargetName?: string; buildTarget?: string; bundler?: 'vite' | 'webpack'; compiler?: 'swc' | 'babel'; } export interface NxComponentTestingPresetOptions extends Omit<NxComponentTestingOptions, 'bundler'> { } export declare function nxBaseCypressPreset(pathToConfig: string, options?: { testingType: 'component' | 'e2e'; }): BaseCypressPreset; /** * nx E2E Preset for Cypress * @description * this preset contains the base configuration * for your e2e tests that nx recommends. * you can easily extend this within your cypress config via spreading the preset * @example * export default defineConfig({ * e2e: { * ...nxE2EPreset(__dirname) * // add your own config here * } * }) * */ export declare function nxE2EPreset(pathToConfig: string, options?: NxCypressE2EPresetOptions): any; export interface WebServerConfig { /** * Timeout to wait for the webserver to start listening */ timeout?: number; /** * Reuse an existing web server if it exists * If this is false, an error will be thrown if the server is already running */ reuseExistingServer?: boolean; } export type NxCypressE2EPresetOptions = { bundler?: string; /** * The directory from the project root, where the cypress files (support, fixtures, specs) are located. * i.e. 'cypress/' or 'src' * default is 'src' **/ cypressDir?: string; /** * A map of commandName -> command to start the web server for testing. * Currently only default is read. */ webServerCommands?: Record<string, string>; /** * A command to start the web server - used for e2e tests distributed by Nx. */ ciWebServerCommand?: string; /** * The url of the web server for ciWebServerCommand */ ciBaseUrl?: string; /** * Configures how the web server command is started and monitored. */ webServerConfig?: WebServerConfig; /** * Configure override inside the vite config */ viteConfigOverrides?: InlineConfig; }; export {}; //# sourceMappingURL=cypress-preset.d.ts.map