-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Library tests fail for projects which don't include @angular/animations module #1377
Comments
Hi, thanks for the info. I got the same error lately, you are right. It's because of the mixture of Currently plan is to fix A13 support. It requires similar changes so the issue should be fixed automatically. Let's keep this issue open, so we could verify that the fix for A13 solves it too. |
Hi @zuzusik, have you been able to solve the issue? Looks like it belongs to Karma and Angular 13 and that files |
Hi @zuzusik, could you try |
@satanTime we haven't moved to Angular 13 yet - I have added a point into our Angular 13 update ticket to try to update ng-mocks and report back in this issue if the fix worked. |
Hi @zuzusik, there is no real dependency between versions, you can use ng-mocks@13 on Angular 5+. |
@satanTime gotcha - thanks for heads up, that's good to know! still we would probably prefer to update everything Angular related when we update to next major version of Angular I might try carve out some time to try to update to ng-mocks 13 outside of that, though |
yep, understand you. It would be great if you could find time to check locally whether it works or not on |
Hello, I have a very similar issue.
downgrading to ng-mocks 12.0.2 solves this issue. |
Hi @GilSokolov, could you post here your |
…-mom#1377 Please add `ngMocks.globalReplace(BrowserAnimationsModule, NoopAnimationsModule);` if you need the old behavior.
…-mom#1377 Please add `ngMocks.globalReplace(BrowserAnimationsModule, NoopAnimationsModule);` if you need the old behavior.
…-mom#1377 Please add `ngMocks.globalReplace(BrowserAnimationsModule, NoopAnimationsModule);` if you need the old behavior.
…-mom#1377 Please add `ngMocks.globalReplace(BrowserAnimationsModule, NoopAnimationsModule);` if you need the old behavior.
fix(core): BrowserAnimationsModule is optional dependency now #1377
feat(core): BrowserAnimationsModule better coverage #1377
v13.4.0 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems. |
We have a library where in tests we use
ng-mocks
. Our project doesn't include@angular/animations
module as we don't use animations in our app. Our Angular is12.2.13
After updating
ng-mocks
from 11.x to latest 12.x (12.5.0
at the moment of writing), following error started to appear when running library tests (ng test <library-name>
), preventing tests from being run:With further investigation traced the issue to ca65de3 which was introduced in
12.1.0
. Double checked and re-assured that version12.0.2
works well.Also, went to dist code of
12.5.0
and commented out this code inng-mocks/cjs/lib/mock-module/create-resolvers.js
, and again it proved to work just fine:https://github.com/ike18t/ng-mocks/blob/17d798e74730fedff3b6af69f5fda70eecb89cc7/libs/ng-mocks/src/lib/mock-module/create-resolvers.ts#L19-L31
My assumption - Angular library builder is slightly different from app builder. I assume it tries to analyze all files for
require
s and to include them in it's own way, and so it tries to include@angular/platform-browser/animations
which then tries to include@angular/animations
and so that fails, but since it all happens out of context of executing the actual file, it's not get caught with thattry/catch
Workarounds:
ng-mocks
12.0.2 (not cool as we stuck with old version)ng-mocks
commenting out the code above (not coll at all - monkey patching should be the last possible resort)The text was updated successfully, but these errors were encountered: