"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/angular_devkit/build_angular/src/dev-server/hmr_spec.ts" between
angular-cli-11.0.1.tar.gz and angular-cli-11.0.2.tar.gz

About: Angular CLI is a command line interface for Angular.

hmr_spec.ts  (angular-cli-11.0.1):hmr_spec.ts  (angular-cli-11.0.2)
skipping to change at line 59 skipping to change at line 59
logs = []; logs = [];
runs = []; runs = [];
page = await browser.newPage(); page = await browser.newPage();
page.on('console', msg => logs.push(msg.text())); page.on('console', msg => logs.push(msg.text()));
host.writeMultipleFiles({ host.writeMultipleFiles({
'src/app/app.component.html': ` 'src/app/app.component.html': `
<p>{{title}}</p> <p>{{title}}</p>
<input type="text"> <input class="visible" type="text">
<input type="hidden">
<select> <select>
<option>one</option> <option>one</option>
<option>two</option> <option>two</option>
</select> </select>
`, `,
}); });
}); });
afterEach(async () => { afterEach(async () => {
await host.restore().toPromise(); await host.restore().toPromise();
skipping to change at line 168 skipping to change at line 168
.pipe( .pipe(
debounceTime(1000), debounceTime(1000),
switchMap(async buildEvent => { switchMap(async buildEvent => {
expect(buildEvent.success).toBe(true); expect(buildEvent.success).toBe(true);
const url = buildEvent.baseUrl as string; const url = buildEvent.baseUrl as string;
switch (buildCount) { switch (buildCount) {
case 0: case 0:
await page.goto(url); await page.goto(url);
expect(logs).toContain('[HMR] Waiting for update signal from WDS.. .'); expect(logs).toContain('[HMR] Waiting for update signal from WDS.. .');
await page.evaluate(() => { await page.evaluate(() => {
document.querySelector('input').value = 'input value'; document.querySelector('input.visible').value = 'input value';
document.querySelector('select').value = 'two'; document.querySelector('select').value = 'two';
}); });
host.replaceInFile('src/app/app.component.ts', `'app'`, `'app-hmr' `); host.replaceInFile('src/app/app.component.ts', `'app'`, `'app-hmr' `);
break; break;
case 1: case 1:
expect(logs).toContain('[HMR] Updated modules:'); expect(logs).toContain('[HMR] Updated modules:');
expect(logs).toContain('[HMR] App is up to date.'); expect(logs).toContain('[HMR] App is up to date.');
expect(logs).toContain('[NG HMR] Restoring input/textarea values.' ); expect(logs).toContain('[NG HMR] Restoring input/textarea values.' );
expect(logs).toContain('[NG HMR] Restoring selected options.'); expect(logs).toContain('[NG HMR] Restoring selected options.');
const inputValue = await page.evaluate(() => document.querySelecto r('input').value); const inputValue = await page.evaluate(() => document.querySelecto r('input.visible').value);
expect(inputValue).toBe('input value'); expect(inputValue).toBe('input value');
const selectValue = await page.evaluate(() => document.querySelect or('select').value); const selectValue = await page.evaluate(() => document.querySelect or('select').value);
expect(selectValue).toBe('two'); expect(selectValue).toBe('two');
break; break;
} }
logs = []; logs = [];
buildCount++; buildCount++;
}), }),
 End of changes. 3 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)