Closed
Description
Steps to reproduce
- I have a plain new Angular v19 project and added Angular Testing Library using this command
ng add @testing-library/angular
- Change src/app/app.component.spec.ts content with code below
import { render, screen } from '@testing-library/angular';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
it('should render Welcome', async () => {
await render(AppComponent);
});
});
- I then proceed to run the test using
ng test
Error
Error: Module not found: Error: Can't resolve '@angular/animations/browser
I've tried importing BrowserAnimationsModule
but still get the same error
import { render, screen } from '@testing-library/angular';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
describe('AppComponent', () => {
it('should render Welcome', async () => {
await render(AppComponent, {
imports: [BrowserAnimationsModule],
});
});
});
Versions
- Angular: ^19.2.0
- "@testing-library/angular": "^17.3.6",
- "@testing-library/dom": "^10.0.0",
- "@testing-library/jest-dom": "^6.4.8",
- "@testing-library/user-event": "^14.5.2",
Metadata
Metadata
Assignees
Labels
No labels