You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a material mixin (I tried tabIndex and errorState)
Run the tests
Expected behavior
The test should pass.
Actual behavior
Determining test suites to run...
ngcc-jest-processor: running ngcc
ts-jest[versions] (WARN) Version 4.1.6 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=4.3.0 <5.0.0-0). Please do not report issues in ts-jest if you are using unsupported versions.
FAIL src/app/app.component.spec.ts
AppComponent
✕ should create the app (58 ms)
● AppComponent › should create the app
TypeError: Class constructor ComponentBase cannot be invoked without 'new'
at new Mixin (../src/material/core/common-behaviors/tabindex.ts:41:5)
at new TestComponent (src/app/test.component.ts:14:27)
at NodeInjectorFactory.TestComponent_Factory [as factory] (ng:/TestComponent/ɵfac.js:5:10)
at getNodeInjectable (../packages/core/src/render3/di.ts:613:38)
at instantiateAllDirectives (../packages/core/src/render3/instructions/shared.ts:1307:23)
at createDirectivesInstances (../packages/core/src/render3/instructions/shared.ts:550:3)
at ɵɵelementStart (../packages/core/src/render3/instructions/element.ts:121:5)
at ɵɵelement (../packages/core/src/render3/instructions/element.ts:180:3)
at AppComponent_Template (ng:/AppComponent.js:10:9)
at executeTemplate (../packages/core/src/render3/instructions/shared.ts:517:5)
at renderView (../packages/core/src/render3/instructions/shared.ts:302:7)
at renderComponent (../packages/core/src/render3/instructions/shared.ts:1775:3)
at renderChildComponents (../packages/core/src/render3/instructions/shared.ts:123:5)
at renderView (../packages/core/src/render3/instructions/shared.ts:331:7)
at ComponentFactory.Object.<anonymous>.ComponentFactory.create (../packages/core/src/render3/component_ref.ts:218:7)
at initComponent (../packages/core/testing/src/r3_test_bed.ts:355:28)
at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
at Object.onInvoke (../packages/core/src/zone/ng_zone.ts:364:29)
at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
at NgZone.Object.<anonymous>.NgZone.run (../packages/core/src/zone/ng_zone.ts:184:50)
at TestBedRender3.Object.<anonymous>.TestBedRender3.createComponent (../packages/core/testing/src/r3_test_bed.ts:358:37)
at Function.Object.<anonymous>.TestBedRender3.createComponent (../packages/core/testing/src/r3_test_bed.ts:182:33)
at src/app/app.component.spec.ts:15:33
at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:409:30)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3830:43)
at _ZoneDelegate.Object.<anonymous>._ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:408:56)
at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:169:47)
at Object.wrappedFunc (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:4330:34)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 2.676 s, estimated 3 s
Ran all test suites.
npm ERR! Test failed. See above for more details.
Additional context
I tried adding the mixing to my project (by copy/pasting the code from the source) and it worked, so it seems to be an issue with importing the mixing specifically
Version
12.2.2
Steps to reproduce
See https://github.com/Granipouss/jest-angular-11-issue for minimal repo
Expected behavior
The test should pass.
Actual behavior
Additional context
I tried adding the mixing to my project (by copy/pasting the code from the source) and it worked, so it seems to be an issue with importing the mixing specifically
Environment
The text was updated successfully, but these errors were encountered: