File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
tests/legacy-cli/e2e/tests/basic Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ import { request } from '../../utils/http' ;
2+ import { killAllProcesses } from '../../utils/process' ;
3+ import { ngServe } from '../../utils/project' ;
4+
5+ export default async function ( ) {
6+ try {
7+ // Serve works without HMR
8+ await ngServe ( '--no-hmr' ) ;
9+ await verifyResponse ( ) ;
10+ killAllProcesses ( ) ;
11+
12+ // Serve works with HMR
13+ await ngServe ( '--hmr' ) ;
14+ await verifyResponse ( ) ;
15+ } finally {
16+ killAllProcesses ( ) ;
17+ }
18+ }
19+
20+ async function verifyResponse ( ) : Promise < void > {
21+ const response = await request ( 'http://localhost:4200/' ) ;
22+
23+ if ( ! / < a p p - r o o t > < \/ a p p - r o o t > / . test ( response ) ) {
24+ throw new Error ( 'Response does not match expected value.' ) ;
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments