Skip to content

Commit 2c8e97d

Browse files
authored
refactor: lift indexHtmlFile up to component, add validation (#20870)
1 parent 771f765 commit 2c8e97d

File tree

86 files changed

+620
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+620
-137
lines changed

cli/types/cypress.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,7 +2858,7 @@ declare namespace Cypress {
28582858
* Override default config options for E2E Testing runner.
28592859
* @default {}
28602860
*/
2861-
e2e: CoreConfigOptions
2861+
e2e: Omit<CoreConfigOptions, 'indexHtmlFile'>
28622862

28632863
/**
28642864
* An array of objects defining the certificates
@@ -2869,6 +2869,8 @@ declare namespace Cypress {
28692869
* Handle Cypress plugins
28702870
*/
28712871
setupNodeEvents: (on: PluginEvents, config: PluginConfigOptions) => Promise<PluginConfigOptions> | PluginConfigOptions
2872+
2873+
indexHtmlFile: string
28722874
}
28732875

28742876
/**
@@ -2971,7 +2973,7 @@ declare namespace Cypress {
29712973
/**
29722974
* Config options that can be assigned on cypress.config.{ts|js} file
29732975
*/
2974-
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern'>
2976+
type UserConfigOptions<ComponentDevServerOpts = any> = Omit<ResolvedConfigOptions<ComponentDevServerOpts>, 'baseUrl' | 'excludeSpecPattern' | 'supportFile' | 'specPattern' | 'indexHtmlFile'>
29752977

29762978
/**
29772979
* Takes ComponentDevServerOpts to track the signature of the devServerConfig for the provided `devServer`,

cli/types/tests/cypress-tests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace CypressConfigTests {
3737
Cypress.config({ e2e: { baseUrl: null }}) // $ExpectType void
3838
Cypress.config({ e2e: { baseUrl: '.', }}) // $ExpectType void
3939
Cypress.config({ component: { baseUrl: '.', devServer: () => ({} as any) } }) // $ExpectError
40+
Cypress.config({ e2e: { indexHtmlFile: 'index.html' } }) // $ExpectError
4041

4142
Cypress.config('taskTimeout') // $ExpectType number
4243
Cypress.config('includeShadowDom') // $ExpectType boolean

npm/webpack-dev-server/index-template.html renamed to npm/angular/cypress/support/component-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<body>
1010
<div id="__cy_root"></div>
1111
</body>
12-
</html>
12+
</html>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html>
33
<head>
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<title>AUT Frame</title>
7+
<title>Components App</title>
88
</head>
99
<body>
1010
<div id="__cy_root"></div>
1111
</body>
12-
</html>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div id="__cy_root"></div>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div id="__cy_root"></div>
11+
</body>
12+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div id="__cy_root"></div>
11+
</body>
12+
</html>

npm/react/plugins/next/index-template.html renamed to npm/react/examples/nextjs-webpack-5/cypress/support/component-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
<body>
1111
<div id="__cy_root"></div>
1212
</body>
13-
</html>
13+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
<div id="__next_css__DO_NOT_USE__"></div>
9+
</head>
10+
<body>
11+
<div id="__cy_root"></div>
12+
</body>
13+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div id="__cy_root"></div>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)