refactor(core): static-query migration should always use template strategy (#30628)

We are removing the prompt for the `static-query` migration and make the
template strategy the migration strategy for the migration. The usage
strategy is good for best-practices, but for now we want to ensure that
the migration is a seamless as possible and that is only achievable my
re-using the same logic that View Engine uses for determining the
timing of a query.

PR Close #30628
This commit is contained in:
Paul Gschwendtner
2019-05-23 00:55:18 +02:00
committed by Jason Aden
parent faac51fd2e
commit 5640cedc82
3 changed files with 12 additions and 73 deletions

View File

@ -1506,23 +1506,6 @@ describe('static-queries migration with usage strategy', () => {
.toContain(`@${queryType}('test', { static: false }) query: any;`);
});
it(`should not prompt for migration strategy if no @${queryType} query is used`, async() => {
writeFile('/index.ts', `
import {Component, ${queryType}} from '@angular/core';
@Component({template: '<span #test></span>'})
export class NoQueriesDeclared {
}
`);
const testModule = require('../migrations/static-queries/strategy_prompt');
spyOn(testModule, 'promptForMigrationStrategy').and.callThrough();
await runMigration();
expect(testModule.promptForMigrationStrategy).toHaveBeenCalledTimes(0);
});
it('should support function call with default parameter value', async() => {
writeFile('/index.ts', `
import {Component, ${queryType}} from '@angular/core';