Test fail when using vitest, Angular 18 and @jscutlery/swc-angular v0.17.0
Hey!
I have a Stepper Component extending the CDKStepper. In it's Provider Array it has something like:
providers: [{provide: CDKStepper, useExisting: CustomStepper}]
Also We have a Custom Step Component having the same but CdkStep and CustomStep
In our tests we use a test Component that is using the Custom Stepper and Steps.
With version < 0.17.0, the CDKStepper gets its Constructor Arguments e.g. ChangeDetectorRef, but in version 0.17.0 it doesn't
The Error:
TypeError: Cannot read properties of undefined (reading '_stateChanged')
It's properly this line
Can't create a example repo for now. Just let me now if you need more infos
Thanks!
@jahusa02 Hi, did you update @swc/core to latest too? If it not help, need detailed reproduction for component and tests.
Also which version of angular you use?
Angular 18 and yes, updated swc to latest version (1.9.X)
Hope I find time for it this weekend. It's the only test that fails in 4k Unit Tests. Kinda weird
https://github.com/jscutlery/devkit/issues/376
This issue is related I guess 🤔 weird that older versions seem to be affected but in another way
@jahusa02 OK try to dig to it soon, to check why that happens, because transpiled code works properly, but original code has problems.