Jest mock a constructor

I am using Angular with Jest to mock a class. I am finding difficulty in mocking the constructor as the test function is invoked within the constructor. Any input on how to mock the constructor with jest would be helpful

export class AppComponent {





return 'Test'


describe( 'AppComponent', () => {
    let fixture: WorkerFormComponent;

    beforeEach( () => {
        fixture = new AppComponent(

Read more here:

Content Attribution

This content was originally published by Subham at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: