title: How to mock ActivatedRoute from Angular 5 tests - error Cannot read property 'params' of undefined
body: <p>This is my constructor with ActivatedRoute</p>
  
  <pre><code>  constructor(private route: ActivatedRoute) {
      this.claimId = +route.snapshot.params["claimId"];
    }
  </code></pre>
  
  <p>And I'm trying to mock this ActivateRoute in tests in that way:</p>
  
  <pre><code>beforeEach((() =&gt; {
      TestBed.configureTestingModule({
        declarations: [TransactionSummaryComponent],
        providers: [{
          provide: useClass: MockClaim
        }, {
          provide: ActivatedRoute, useValue: {
            params: Observable.of({ claimId: 1 })
          }
        }]
      });
  </code></pre>
  
  <p>But whilst building tests I receiving an error: <code>TypeError: Cannot read property 'params' of undefined</code></p>