refactor: lift indexHtmlFile up to component, add validation (#20870)

This commit is contained in:
Zachary Williams
2022-04-01 09:45:21 -05:00
committed by GitHub
parent 771f7654be
commit 2c8e97df24
86 changed files with 620 additions and 137 deletions
+4 -2
View File
@@ -2858,7 +2858,7 @@ declare namespace Cypress {
* Override default config options for E2E Testing runner.
* @default {}
*/
e2e: CoreConfigOptions
e2e: Omit<CoreConfigOptions, 'indexHtmlFile'>
/**
* An array of objects defining the certificates
@@ -2869,6 +2869,8 @@ declare namespace Cypress {
* Handle Cypress plugins
*/
setupNodeEvents: (on: PluginEvents, config: PluginConfigOptions) => Promise<PluginConfigOptions> | PluginConfigOptions
indexHtmlFile: string
}
/**
@@ -2971,7 +2973,7 @@ declare namespace Cypress {
/**
* Config options that can be assigned on cypress.config.{ts|js} file
*/
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern'>
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern' | 'indexHtmlFile'>
/**
* Takes ComponentDevServerOpts to track the signature of the devServerConfig for the provided `devServer`,
+1
View File
@@ -37,6 +37,7 @@ namespace CypressConfigTests {
Cypress.config({ e2e: { baseUrl: null }}) // $ExpectType void
Cypress.config({ e2e: { baseUrl: '.', }}) // $ExpectType void
Cypress.config({ component: { baseUrl: '.', devServer: () => ({} as any) } }) // $ExpectError
Cypress.config({ e2e: { indexHtmlFile: 'index.html' } }) // $ExpectError
Cypress.config('taskTimeout') // $ExpectType number
Cypress.config('includeShadowDom') // $ExpectType boolean