test(migrations): add more tests to output migration (#57671)

This change contains an additonal test that captures scenario
of the problematic .pipe usage outside of the directive class.

PR Close #57671
This commit is contained in:
Pawel Kozlowski 2024-09-05 11:40:19 +02:00 committed by Jessica Janiuk
parent c3e5b0a0b0
commit f1bbbeab0c

View file

@ -174,6 +174,21 @@ describe('outputs', () => {
`);
});
it('should _not_ migrate outputs that are used with .pipe outside of a component class', () => {
verifyNoChange(`
import {Directive, Output, EventEmitter} from '@angular/core';
@Directive()
export class TestDir {
@Output() someChange = new EventEmitter();
}
let instance: TestDir;
instance.someChange.pipe();
`);
});
it('should _not_ migrate outputs that are used with .complete', () => {
verifyNoChange(`
import {Directive, Output, EventEmitter, OnDestroy} from '@angular/core';