MockBuilder: RouterModule imported in an AppRoutingModule
See original GitHub issueHi again, When I use MockBuilder to test an AppComponent and that the RouterModule is imported from an AppRoutingModule. I get this error :
Error: Unexpected value 'undefined' exported by the module 'MockOfAppRoutingModule'
You can see the error in StackBlitz. The code works fine in production.
angular.json Production : projects -> demo -> architect -> build -> options -> main ->
src/main.ts
Testing : projects -> demo -> architect -> build -> options -> main ->src/main-testing.ts
Thanks in advance. Best regards. Cyril
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Error: 'AppRoutingModule' module can't import itself
In your first snippet (the app routing module), you have: imports: [RouterModule.forRoot(appRoutes,{ enableTracing: true }) ...
Read more >How to test a route in Angular application - ng-mocks
The next and very import step is to wrap a test callback in it with fakeAsync function and to render RouterOutlet . We...
Read more >Add navigation with routing
The following line adds the RouterModule to the AppRoutingModule imports array and configures it with the routes in one step by calling RouterModule....
Read more >Routing in Angular - Mercy Jemosop - Medium
The RouterModule and Routes imported to the app-routing.module.ts adds the routing functionality to the application. Routes. Routes tell the Router which view ...
Read more >1c - Brief Introduction To Angular - Angular and NgRx - GitBook
src/app/app-routing.module.ts. import { NgModule } from '@angular/core';. import { Routes, RouterModule } from '@angular/router';. import { HomeComponent } ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like the issue isn’t much related to ng-mocks: https://github.com/angular/angular/issues/17013
Good news, I found the issue and fixed it. Next hours I’ll release a new version with the fix.