ngMocks.globalMock marks declarations, services and tokens to be mocked if they appear in kept modules during creating mock modules.
The best place to do that is in
jasmine or in
Let's mark the
APP_URL token in order to be mocked in its kept modules.
// test.tsngMocks.globalKeep(AppModule);ngMocks.globalMock(APP_URL);ngMocks.defaultMock(APP_URL, () => 'mock');
// test.spec.ts// ...MockModule(AppModule);// ...const url = TestBed.inject(APP_URL);// ...