无法读取未定义的属性“执行”

时间:2019-01-18 13:28:38

标签: jestjs angular7 rxjs6 angular-cdk

我正在测试包含新CdkVirtualScrollViewport组件的angular 7组件,但出现了奇怪的错误。

Failed: Cannot read property 'execute' of undefined
      TypeError: Cannot read property 'execute' of undefined
      at AnimationFrameScheduler.Object.<anonymous>.AnimationFrameScheduler.flush (node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts:17:26)
      at node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts:28:23
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (node_modules/zone.js/dist/zone.js:421:31)
      at AsyncTestZoneSpec.Object.<anonymous>.AsyncTestZoneSpec.onInvokeTask (node_modules/zone.js/dist/async-test.js:90:25)
      at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvokeTask (node_modules/zone.js/dist/proxy.js:156:39)
      at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (node_modules/zone.js/dist/zone.js:420:36)
      at Zone.Object.<anonymous>.Zone.runTask (node_modules/zone.js/dist/zone.js:188:47)
      at Object.<anonymous>.ZoneTask.invokeTask (node_modules/zone.js/dist/zone.js:496:34)
      at ZoneTask.invoke (node_modules/zone.js/dist/zone.js:485:48)
      at timer (node_modules/zone.js/dist/zone.js:2054:29)
      at ontimeout (timers.js:436:11)
      at tryOnTimeout (timers.js:300:5)
      at listOnTimeout (timers.js:263:5)
      at Timer.processTimers (timers.js:223:10)

我的组件模板是

<cdk-virtual-scroll-viewport itemSize="48" class="scroll-container">
    <ng-container *cdkVirtualFor="let item of data.listItems">
        <some-component> {{ item }}</some-component>
    </ng-container>
</cdk-virtual-scroll-viewport>

0 个答案:

没有答案