-
-
Notifications
You must be signed in to change notification settings - Fork 287
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Please provide the environment you discovered this bug in.
Angular 20.2.2
Angular Material & CDK 20.2.5
Analog 1.19.4
Which area/package is the issue in?
vitest-angular
Description
The @analogjs/vitest-angular-esm-plugin
plugin config "includes" @angular/cdk
. As @angular/cdk
is also used transitively through @angular/material
harnesses, we end up with two instances of the module and two different references to HarnessPredicate
for instance.
This will make instanceof
checks fail when the the harness is created by @angular/material
and used in tests. Note that harnesses created by the user will generally still work.
Ideally, @analogjs/vitest-angular-esm-plugin
should only:
- add
optimizeDeps: {include: ['tslib']}
- and keep the async/await downgrade logic if a
zoneless
option is set tofalse
:(/fesm2022/.test(id) && _code.includes('async ')) ||
Another workaround is to inline @angular/material
but the side effect is that it makes vitest load and transform more code, thus slowing down the tests.
Please provide the exception or error you saw
SyntaxError: '' is not a valid selector
Other information
No response
I would be willing to submit a PR to fix this issue
- Yes
- No
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working