### Is this a regression? - [X] Yes, this behavior used to work in the previous version ### The previous version in which this bug was not present was 16.2.12 ### Description When upgrading from material 16.2.12 to 17.0.0 ; when a jest test runs and the class has a dependency to MatDialog: <img width="1101" alt="image" src="https://github.com/angular/components/assets/1098243/7e939bac-ee59-4e9f-94e3-df0277a745f3"> ### Reproduction StackBlitz link: Steps to reproduce: 1. 2. ### Expected Behavior no crash ### Actual Behavior crash ### Environment - Angular: 17.0.3 - CDK/Material: 17.0.0 - Browser(s): any - Operating System (e.g. Windows, macOS, Ubuntu): windows