Skip to content

Commit 012d58c

Browse files
fix: Added types for runtime config. (#14584)
Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
1 parent 9216f05 commit 012d58c

File tree

1 file changed

+105
-1
lines changed

1 file changed

+105
-1
lines changed

cli/types/cypress.d.ts

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ declare namespace Cypress {
281281
// {defaultCommandTimeout: 10000, pageLoadTimeout: 30000, ...}
282282
```
283283
*/
284-
config(): ResolvedConfigOptions
284+
config(): ResolvedConfigOptions & RuntimeConfigOptions
285285
/**
286286
* Returns one configuration value.
287287
* @see https://on.cypress.io/config
@@ -2614,6 +2614,110 @@ declare namespace Cypress {
26142614
includeShadowDom: boolean
26152615
}
26162616

2617+
/**
2618+
* Options appended to config object on runtime.
2619+
*/
2620+
interface RuntimeConfigOptions {
2621+
/**
2622+
* CPU architecture, from Node `os.arch()`
2623+
*
2624+
* @see https://nodejs.org/api/os.html#os_os_arch
2625+
*/
2626+
arch: string
2627+
/**
2628+
* The list of hosts to be blocked
2629+
*/
2630+
blockHosts: null | string | string[]
2631+
/**
2632+
* The browser Cypress is running on.
2633+
*/
2634+
browser: Browser
2635+
/**
2636+
* Available browsers found on your system.
2637+
*/
2638+
browsers: Browser[]
2639+
/**
2640+
* Path to folder containing component test files.
2641+
*/
2642+
componentFolder: string
2643+
/**
2644+
* Whether component testing is enabled.
2645+
*/
2646+
experimentalComponentTesting: boolean
2647+
/**
2648+
* Hosts mappings to IP addresses.
2649+
*/
2650+
hosts: null | string[]
2651+
/**
2652+
* Whether Cypress was launched via 'cypress open' (interactive mode)
2653+
*/
2654+
isInteractive: boolean
2655+
/**
2656+
* Whether Cypress will search for and replace
2657+
* obstructive JS code in .js or .html files.
2658+
*
2659+
* @see https://on.cypress.io/configuration#modifyObstructiveCode
2660+
*/
2661+
modifyObstructiveCode: boolean
2662+
/**
2663+
* The platform Cypress is running on.
2664+
*/
2665+
platform: 'linux' | 'darwin' | 'win32'
2666+
/**
2667+
* A unique ID for the project used for recording
2668+
*/
2669+
projectId: null | string
2670+
/**
2671+
* Path to the support folder.
2672+
*/
2673+
supportFolder: string
2674+
/**
2675+
* Glob pattern to determine what test files to load.
2676+
*/
2677+
testFiles: string
2678+
/**
2679+
* The user agent the browser sends in all request headers.
2680+
*/
2681+
userAgent: null | string
2682+
/**
2683+
* The Cypress version being used.
2684+
*/
2685+
version: string
2686+
2687+
// Internal or Unlisted at server/lib/config_options
2688+
autoOpen: boolean
2689+
browserUrl: string
2690+
clientRoute: string
2691+
configFile: string
2692+
cypressEnv: string
2693+
integrationExampleName: string
2694+
integrationExamplePath: string
2695+
isNewProject: boolean
2696+
isTextTerminal: boolean
2697+
morgan: boolean
2698+
namespace: string
2699+
parentTestsFolder: string
2700+
parentTestsFolderDisplay: string
2701+
projectName: string
2702+
projectRoot: string
2703+
proxyUrl: string
2704+
report: boolean
2705+
reporterRoute: string
2706+
reporterUrl: string
2707+
socketId: null | string
2708+
socketIoCookie: string
2709+
socketIoRoute: string
2710+
spec: {
2711+
absolute: string
2712+
name: string
2713+
relative: string
2714+
specFilter: null | string
2715+
specType: 'integration' | 'component'
2716+
}
2717+
xhrRoute: string
2718+
xhrUrl: string
2719+
}
2720+
26172721
interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'baseUrl' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations'>> {
26182722
browser?: IsBrowserMatcher | IsBrowserMatcher[]
26192723
}

0 commit comments

Comments
 (0)