title: Angular 2/Jasmine, updating an activated route params subscription within each describe/it block
body: <p>Given a simple component that subscribes to the activated route query params in <code>ngOnInit</code>:</p>
  
  <pre><code>export class FooComponent implements OnInit {
    private queryParams: any;
  
    constructor(
      private activatedRoute: ActivatedRoute
    ) { }
  
    ngOnInit() {
      this.activatedRoute.queryParams.subscribe(params =&gt; this.queryParams = params);
    }
  
    active(foo: number): boolean {
      return this.queryParams['foo'] &amp;&amp;
        foo === +this.queryParams['foo'];
    }
  }
  </code></pre>
  
  <p>The active function should return true when the <code>foo</code> query param is present and its value matches the supplied parameter.</p>
  
  <p>In the accompanying unit tests for this component, I want to change the value of the query params within each <code>it</code> block to test the query param not being present, matching the parameter and not matching the parameter.</p>
  
  <pre><code>describe('FooComponent', () =&gt; {
    let component: FooComponent;
    let fixture: ComponentFixture&lt;FooComponent&gt;;
    let activatedRoute: ActivatedRoute;
  
    class MockActivatedRoute {
      queryParams = Observable.of({});
    }
  
    beforeEach(async(() =&gt; {
      TestBed.configureTestingModule({
        declarations: [FooComponent],
        providers: [
          { provide: ActivatedRoute, useClass: MockActivatedRoute }
        ]
      })
        .compileComponents();
    }));
  
    beforeEach(() =&gt; {
      fixture = TestBed.createComponent(FooComponent);
      component = fixture.componentInstance;
      fixture.detectChanges();
  
      activatedRoute = fixture.debugElement.injector.get(ActivatedRoute);
    });
  
    describe('active', () =&gt; {
      it('should return false if the foo query param is not present', () =&gt; {
        activatedRoute.queryParams = Observable.of({});
        let result = component.active(100);
        expect(result).toBe(false);
      });
  
      it('should return false if the foo query param does not match the supplied parameter', () =&gt; {
        activatedRoute.queryParams = Observable.of({ foo: '500' });
        let result = component.active(100);
        expect(result).toBe(false);
      });
  
      it('should return true if the foo query param does not match the supplied parameter', () =&gt; {
        activatedRoute.queryParams = Observable.of({ foo: '500' });
        let result = component.active(500);
        expect(result).toBe(true);
      });
    });
  });
  </code></pre>
  
  <p>Rather the value of the private queryParams member of the FooComponent class does not update within each <code>it</code> block. I've tried the various methods of <code>async</code>, <code>fixture.whenStable()</code>, and <code>fakeAsync/tick</code>.</p>
  
  <p>How do I update the value of the subscription for each unit test?</p>