Angular Material and Jasmine : " No provider for InjectionToken MdDialogData! " : <p>I have a component which is meant to be used in an Angular Material MdDialog :</p>

<pre><code>@Component({
  ...
})
export class MyComponent {

  constructor(@Inject(MD_DIALOG_DATA) public data: any, public dialogRef: 
MdDialogRef&lt;MyComponent&gt;) {
...
  }


}
</code></pre>

<p>I am trying to Unit Test it with Jasmine :</p>

<pre><code>describe('MyComponent', () =&gt; {
  let component: MyComponent;
  let fixture: ComponentFixture&lt;MyComponent&gt;;

  beforeEach(async(() =&gt; {
    TestBed.configureTestingModule({
      imports: [
        SharedTestingModule,
      ],
      declarations: [
        MyComponent,
      ],
    })
    .compileComponents();
  }));

  ...

});
</code></pre>

<p>Unfortunately, I am getting the following error :</p>

<blockquote>
  <p>Error: No provider for InjectionToken MdDialogData!</p>
</blockquote>

<p>SharedTestingModule imports and exports my custom Angular Material module, which itself imports and exports MdDialogModule.</p>

<p>How can I get rid of this error?</p>

<p>Thank you very much!</p>

<pre><code>Angular 4.2.4
Angular Material 2.0.0-beta.7
Jasmine 2.5.3
</code></pre>
