I am having an issue issue when running tests with Jest-Preset-Angular on a component that has an animation on host element imported from a seperate file (so it can be reused in another component).
example.animation.ts
import { trigger } from '@angular/animations';
export const ExampleAnimationHost = { '[@example]': '' };
export const ExampleAnimationTrigger = trigger('example', []);
example.component.ts
import { Component } from '@angular/core';
import { ExampleAnimationHost, ExampleAnimationTrigger } from './example.animation';
@Component({
selector: 'app-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.scss'],
animations: [ExampleAnimationTrigger],
host: ExampleAnimationHost,
})
export class ExampleComponent { }
The fact is that if I copy-paste the trigger into the animations
property of the @Component
decorator my test pass ... otherwise it fails as it doesn't seems to find the animation declaration.
Any ideas?