@@ -40,8 +40,9 @@ const TEST_WEBPACK_CONFIG = {
40
40
} ,
41
41
} ;
42
42
43
- const testBuildInfo =
44
- JSON . parse ( fs . readFileSync ( `${ TEST_CONTEXT } /.build-info` ) ) ;
43
+ const testBuildInfo = JSON . parse (
44
+ fs . readFileSync ( `${ TEST_CONTEXT } /.build-info` ) ,
45
+ ) ;
45
46
46
47
beforeAll ( ( ) => {
47
48
Helmet . canUseDOM = false ;
@@ -84,11 +85,11 @@ async function coreTest(webpackConfig, options) {
84
85
}
85
86
}
86
87
87
- test ( 'Base rendering of HTML template' , ( ) =>
88
- coreTest ( TEST_WEBPACK_CONFIG , { } ) ) ;
88
+ test ( 'Base rendering of HTML template' ,
89
+ ( ) => coreTest ( TEST_WEBPACK_CONFIG , { } ) ) ;
89
90
90
- test ( 'Config overriding for injection' , ( ) =>
91
- coreTest ( TEST_WEBPACK_CONFIG , {
91
+ test ( 'Config overriding for injection' ,
92
+ ( ) => coreTest ( TEST_WEBPACK_CONFIG , {
92
93
beforeRender : async ( res , sanitizedConfig ) => {
93
94
expect ( res ) . toEqual ( TEST_HTTP_REQUEST ) ;
94
95
expect ( sanitizedConfig ) . toBeInstanceOf ( Object ) ;
@@ -102,22 +103,28 @@ test('Config overriding for injection', () =>
102
103
} ,
103
104
} ) ) ;
104
105
105
- test ( 'Hemlet integration works' , ( ) =>
106
- coreTest ( TEST_WEBPACK_CONFIG , {
106
+ test ( 'Hemlet integration works' ,
107
+ ( ) => coreTest ( TEST_WEBPACK_CONFIG , {
107
108
Application : ( ) => (
108
109
< div >
109
- < p > Hello World!</ p >
110
+ < p >
111
+ Hello World!
112
+ </ p >
110
113
< Helmet >
111
- < title > Test Page Title</ title >
114
+ < title >
115
+ Test Page Title
116
+ </ title >
112
117
< meta property = "description" content = "Test Page Description" />
113
118
</ Helmet >
114
- < p > Goodbye World!</ p >
119
+ < p >
120
+ Goodbye World!
121
+ </ p >
115
122
</ div >
116
123
) ,
117
124
} ) ) ;
118
125
119
- test ( 'Injection of additional JS scripts' , ( ) =>
120
- coreTest ( TEST_WEBPACK_CONFIG , {
126
+ test ( 'Injection of additional JS scripts' ,
127
+ ( ) => coreTest ( TEST_WEBPACK_CONFIG , {
121
128
beforeRender : async ( ) => ( {
122
129
extraScripts : [
123
130
'<script>Dummy JS Sript</script>' ,
@@ -126,14 +133,18 @@ test('Injection of additional JS scripts', () =>
126
133
} ) ,
127
134
} ) ) ;
128
135
129
- test ( 'Server-side rendering (SSR); injection of CSS chunks & Redux state' , ( ) =>
130
- coreTest ( TEST_WEBPACK_CONFIG , {
136
+ test ( 'Server-side rendering (SSR); injection of CSS chunks & Redux state' ,
137
+ ( ) => coreTest ( TEST_WEBPACK_CONFIG , {
131
138
Application : ( ) => (
132
139
< Route
133
140
component = { ( { staticContext } ) => {
134
141
staticContext . chunks . push ( 'test-chunk-a' ) ;
135
142
staticContext . chunks . push ( 'test-chunk-b' ) ;
136
- return < div > Hello Wold!</ div > ;
143
+ return (
144
+ < div >
145
+ Hello Wold!
146
+ </ div >
147
+ ) ;
137
148
} }
138
149
/>
139
150
) ,
@@ -148,7 +159,11 @@ test('Setting of response HTTP status the server-side rendering', () => {
148
159
< Route
149
160
component = { ( { staticContext } ) => {
150
161
staticContext . status = 404 ; // eslint-disable-line no-param-reassign
151
- return < div > 404 Error Test</ div > ;
162
+ return (
163
+ < div >
164
+ 404 Error Test
165
+ </ div >
166
+ ) ;
152
167
} }
153
168
/>
154
169
) ,
0 commit comments