question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MockBuilder: RouterModule imported in an AppRoutingModule

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
satanTimecommented, Jul 11, 2020

Looks like the issue isn’t much related to ng-mocks: https://github.com/angular/angular/issues/17013

0reactions
satanTimecommented, Jul 12, 2020

Good news, I found the issue and fixed it. Next hours I’ll release a new version with the fix.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found