| 946 | |
| 947 | it('should throw if required query is read in the constructor', () => { |
| 948 | @Component({ |
| 949 | template: `<div #el></div>`, |
| 950 | }) |
| 951 | class AppComponent { |
| 952 | divEl = viewChild.required<ElementRef<HTMLDivElement>>('el'); |
| 953 | |
| 954 | constructor() { |
| 955 | this.divEl(); |
| 956 | } |
| 957 | } |
| 958 | |
| 959 | // non-required query results are undefined before we run creation mode on the view queries |
| 960 | expect(() => { |