Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOMTestComponentRenderer.insertRootElement when mocking document.querySelectorAll #284

Closed
argelj289 opened this issue Dec 21, 2020 · 1 comment

Comments

@argelj289
Copy link

when I try to use spyOn to document.querySelectorAll, it gives me error like

TypeError: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at DOMTestComponentRenderer.insertRootElement (http://localhost:9876/packages/platform-browser-dynamic/testing/src/dom_test_component_renderer.ts:29:34)
    at TestBedRender3.createComponent (http://localhost:9876/packages/core/testing/src/r3_test_bed.ts:336:27)
    at Function.createComponent (http://localhost:9876/packages/core/testing/src/r3_test_bed.ts:182:33)
    at setup (http://localhost:9876/_karma_webpack_/src/app/components/message-management/message/message.component.spec.ts:838:29)
    at UserContext.apply (http://localhost:9876/_karma_webpack_/src/app/components/message-management/message/message.component.spec.ts:931:65)
    at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone.js:386:30)
    at ProxyZoneSpec.onInvoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:292:43)
    at ZoneDelegate.invoke (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone.js:385:36)
    at Zone.run (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone.js:143:47)
    at runInTestZone (http://localhost:9876/_karma_webpack_/node_modules/zone.js/dist/zone-testing.js:545:38)

@johnjbarton
Copy link
Contributor

testing/src/dom_test_component_renderer.ts:29 <-- look there.

This is not related to karma-jasmine, jasmine, or karma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants