Skip to content

Commit

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

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

Fixes #27691
  • Loading branch information
theonly1me committed Jun 14, 2024
1 parent 73c7aa6 commit aa7be7f
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 aa7be7f

Please sign in to comment.