-
Notifications
You must be signed in to change notification settings - Fork 312
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
Cannot read property trim of undefined #170
Comments
Running into the same issue. Isn't it best practices to use the |
Same issue here, and unfortunately importing NoopAnimationsModule isn't doing the trick. No repo available to upload for this one. The error:
The component ( The module for
Things tried so far: |
add current code to jestGlobalMocks.ts /**
* ISSUE: https://github.com/thymikee/jest-preset-angular/issues/170
* Workaround: https://github.com/angular/angular/issues/24094
*/
if (document.body.style.animation === undefined && CSSStyleDeclaration) {
CSSStyleDeclaration.prototype.animation = '';
}
if (document.body.style['animation-name'] === undefined && CSSStyleDeclaration) {
CSSStyleDeclaration.prototype['animation-name'] = '';
CSSStyleDeclaration.prototype['animationName'] = '';
}
if (document.body.style['animation-duration'] === undefined && CSSStyleDeclaration) {
CSSStyleDeclaration.prototype['animation-duration'] = '';
CSSStyleDeclaration.prototype['animationDuration'] = '';
}
if (document.body.style['animation-play-state'] === undefined && CSSStyleDeclaration) {
CSSStyleDeclaration.prototype['animation-play-state'] = '';
CSSStyleDeclaration.prototype['animationPlayState'] = '';
} |
Solved by #229 (available in v7) |
This happens if I don't import
NoopAnimationsModule
into the spec file.How do I globally mock this so I don't have to import
NoopAnimationsModule
every time?This is the culprit function:
The text was updated successfully, but these errors were encountered: