title: TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable. at <Jasmine>
body: <p>Hi I ahve added this piece of code in ngonit, for polling and after adding this all my test cases are getting failed. Please help how to resolve?</p>
  <pre><code>  ngOnInit(): void {
  this.timeInterval = interval(5000)
  .pipe(
    startWith(0),
    switchMap(() =&gt; this.deviceService.getDeviceList())
  )
  .pipe(
    takeUntil(this.deviceService.flag$),
    repeatWhen(() =&gt; this.deviceService.flag$)
  )
  .subscribe((success: any) =&gt; {
    this.gridApi?.setRowData(this.updatedData);
    console.log(&quot;hello&quot;)
    this.updatedData = success;
  }, retry(2));
  </code></pre>
  <p>This is the complete error</p>
  <pre><code>HeadlessChrome 88.0.4324 (Windows 10.0.0) DeviceComponent testing columnresize of the grid for other scenario FAILED
      TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
          at &lt;Jasmine&gt;
          at subscribeTo (http://localhost:9876/_karma_webpack_/node_modules/rxjs/_esm2015/internal/util/subscribeTo.js:27:1)
          at innerSubscribe (http://localhost:9876/_karma_webpack_/node_modules/rxjs/_esm2015/internal/innerSubscribe.js:69:23)
          at TakeUntilOperator.call (http://localhost:9876/_karma_webpack_/node_modules/rxjs/_esm2015/internal/operators/takeUntil.js:11:52)
          at Observable.subscribe (http://localhost:9876/_karma_webpack_/node_modules/rxjs/_esm2015/internal/Observable.js:23:1)
          at RepeatWhenOperator.call (http://localhost:9876/_karma_webpack_/node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js:11:1)
          at Observable.subscribe (http://localhost:9876/_karma_webpack_/node_modules/rxjs/_esm2015/internal/Observable.js:23:1)
          at DeviceComponent.ngOnInit (http://localhost:9876/_karma_webpack_/src/app/device/device.component.ts:99:4)
          at callHook (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3937:1)
          at callHooks (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3901:1)
          at executeInitAndCheckHooks (http://localhost:9876/_karma_webpack_/node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3842:1)
      Failed: Cannot read property 'unsubscribe' of undefined
          at &lt;Jasmine&gt;
          at DeviceComponent.ngOnDestroy (http://localhost:9876/_karma_webpack_/main.js:28373:23)
          at UserContext.&lt;anonymous&gt; (http://localhost:9876/_karma_webpack_/src/app/device/device.component.spec.ts:196:15)
          at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:365:1)
          at AsyncTestZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:763:1)
          at ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:302:1)
          at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:364:1)
          at Zone.runGuarded (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:134:1)
          at runInTestZone (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:885:1)
          at UserContext.&lt;anonymous&gt; (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:823:1)
          at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-evergreen.js:365:1)
  </code></pre>
  <p>HeadlessChrome 88.0.4324 (Windows 10.0.0): Executed 1 of 385 (1 FAILED) (0 secs / 1.732 secs)
  HeadlessChrome 88.0.4324 (Windows 10.0.0) DeviceComponent testing columnresize of the grid for other scenario FAILED
  TypeError: You provided 'undefined' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
  at 
  at subscribeTo (http://localhost:9876/<em>karma_webpack</em>/node_modules/rxjs/_esm2015/internal/util/subscribeTo.js:27:1)
  at innerSubscribe (http://localhost:9876/<em>karma_webpack</em>/node_modules/rxjs/_esm2015/internal/innerSubscribe.js:69:23)
  at TakeUntilOperator.call (http://localhost:9876/<em>karma_webpack</em>/node_modules/rxjs/_esm2015/internal/operators/takeUntil.js:11:52)
  at Observable.subscribe (http://localhost:9876/<em>karma_webpack</em>/node_modules/rxjs/_esm2015/internal/Observable.js:23:1)
  at RepeatWhenOperator.call (http://localhost:9876/<em>karma_webpack</em>/node_modules/rxjs/_esm2015/internal/operators/repeatWhen.js:11:1)
  at Observable.subscribe (http://localhost:9876/<em>karma_webpack</em>/node_modules/rxjs/_esm2015/internal/Observable.js:23:1)
  at DeviceComponent.ngOnInit (http://localhost:9876/<em>karma_webpack</em>/src/app/device/device.component.ts:99:4)
  at callHook (http://localhost:9876/<em>karma_webpack</em>/node_modules/@angular/core/<strong>ivy_ngcc</strong>/fesm2015/core.js:3937:1)
  at callHooks (http://localhost:9876/<em>karma_webpack</em>/node_modules/@angular/core/<strong>ivy_ngcc</strong>/fesm2015/core.js:3901:1)
  at executeInitAndCheckHooks (http://localhost:9876/<em>karma_webpack</em>/node_modules/@angular/core/<strong>ivy_ngcc</strong>/fesm2015/core.js:3842:1)
  Failed: Cannot read property 'unsubscribe' of undefined
  at 
  at DeviceComponent.ngOnDestroy (http://localhost:9876/<em>karma_webpack</em>/main.js:28373:23)
  at UserContext. (http://localhost:9876/<em>karma_webpack</em>/src/app/device/device.component.spec.ts:196:15)
  at ZoneDelegate.invoke (http://localhost:9876/<em>karma_webpack</em>/node_modules/zone.js/dist/zone-evergreen.js:365:1)</p>