getsaf / shallow-render

Angular testing made easy with shallow rendering and easy mocking. https://getsaf.github.io/shallow-render
MIT License
273 stars 25 forks source link

this.delegate.createRenderer is not a function #207

Closed f1am3d closed 2 years ago

f1am3d commented 3 years ago
this.delegate.createRenderer is not a function
TypeError: this.delegate.createRenderer is not a function
    at DebugRendererFactory2.Object.<anonymous>.DebugRendererFactory2.createRenderer (C:\Users\user\Projects\project\js-storefront\packages\core\src\view\services.ts:661:45)
    at createRootData (C:\Users\user\Projects\project\js-storefront\packages\core\src\view\services.ts:129:36)
    at Object.debugCreateRootView [as createRootView] (C:\Users\user\Projects\project\js-storefront\packages\core\src\view\services.ts:116:16)
    at ComponentFactory_.Object.<anonymous>.ComponentFactory_.create (C:\Users\user\Projects\project\js-storefront\packages\core\src\view\refs.ts:92:27)
    at initComponent (C:\Users\user\Projects\project\js-storefront\packages\core\testing\src\test_bed.ts:618:28)
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:386:30)
    at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\proxy.js:117:43)
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:385:36)
    at Object.onInvoke (C:\Users\user\Projects\project\js-storefront\packages\core\src\zone\ng_zone.ts:326:29)
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:385:36)
    at Zone.Object.<anonymous>.Zone.run (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:143:47)
    at NgZone.Object.<anonymous>.NgZone.run (C:\Users\user\Projects\project\js-storefront\packages\core\src\zone\ng_zone.ts:180:50)
    at TestBedViewEngine.Object.<anonymous>.TestBedViewEngine.createComponent (C:\Users\user\Projects\project\js-storefront\packages\core\testing\src\test_bed.ts:622:56)
    at Function.Object.<anonymous>.TestBedViewEngine.createComponent (C:\Users\user\Projects\project\js-storefront\packages\core\testing\src\test_bed.ts:245:36)
    at Renderer.<anonymous> (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\shallow-render\lib\models\renderer.ts:107:29)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\shallow-render\dist\lib\models\renderer.js:5:58)
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:386:30)
    at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\proxy.js:117:43)
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:385:36)
    at Zone.Object.<anonymous>.Zone.run (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:143:47)
    at C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:891:38
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:421:35)
    at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvokeTask (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\proxy.js:148:43)
    at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:420:40)
    at Zone.Object.<anonymous>.Zone.runTask (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:188:51)
    at drainMicroTaskQueue (C:\Users\user\Projects\project\js-storefront\dp-storefront\node_modules\zone.js\dist\zone.js:601:39)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
getsaf commented 3 years ago

Not a lot of detail here, could you give more details?

Is it similar to this issue?:

f1am3d commented 3 years ago

Not a lot of detail here, could you give more details?

  • Which version of Angular?

10.2

  • Which version of Shallow-render?

latest

  • What does your test look like?

As here: https://github.com/getsaf/shallow-render#super-simple-tests

  • What does your component look like?

There's a lot of code.

  • Which 3rd party modules are you using?

A lot of them. It's an enterprise app.

Is it similar to this issue?:

No, there's no errors with Chrome browser.

getsaf commented 3 years ago

The latest version of shallow-render is not compatible with Angular 10. Try using shallow-render 10x.

npm i -D shallow-render@10