Skip to content

Commit

Permalink
fix(@schematics/angular): update schematics to use RouterModule when …
Browse files Browse the repository at this point in the history
…--routing flag is present

update schematics to use RouterModule instead of RouterTestingModule when generating a new project with the --routing flag

Fixes #27691

(cherry picked from commit e3b8b78)
  • Loading branch information
theonly1me authored and alan-agius4 committed Jun 17, 2024
1 parent 405c148 commit 5c705e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TestBed } from '@angular/core/testing';<% if (routing) { %>
import { RouterTestingModule } from '@angular/router/testing';<% } %>
import { RouterModule } from '@angular/router';<% } %>
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({<% if (routing) { %>
imports: [
RouterTestingModule
RouterModule.forRoot([])
],<% } %>
declarations: [
AppComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
RouterModule.forRoot([])
],
declarations: [
AppComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(() => TestBed.configureTestingModule({
imports: [RouterTestingModule],
imports: [RouterModule.forRoot([])],
declarations: [AppComponent]
}));

Expand Down

0 comments on commit 5c705e8

Please sign in to comment.