From 7501dc9912bc88c89688ab48ff4c0987b26172a6 Mon Sep 17 00:00:00 2001 From: satanTime Date: Sun, 3 Apr 2022 15:29:30 +0200 Subject: [PATCH] fix(core): removing isNgModuleDefWithProviders from exports #2173 --- libs/ng-mocks/src/index.ts | 1 - tests/issue-197/with-providers.spec.ts | 8 ++------ tests/issue-271/test.spec.ts | 8 ++------ tests/issue-312/test.spec.ts | 8 ++------ tests/issue-589/test.spec.ts | 9 ++------- tests/issue-625/test.spec.ts | 9 ++------- tests/issue-762/module.spec.ts | 8 ++------ 7 files changed, 12 insertions(+), 39 deletions(-) diff --git a/libs/ng-mocks/src/index.ts b/libs/ng-mocks/src/index.ts index 6a43048e8c..0d883840f0 100644 --- a/libs/ng-mocks/src/index.ts +++ b/libs/ng-mocks/src/index.ts @@ -17,7 +17,6 @@ export * from './lib/common/func.is-mock-validator'; export * from './lib/common/func.is-mocked-ng-def-of'; export * from './lib/common/func.is-ng-def'; export * from './lib/common/func.is-ng-injection-token'; -export * from './lib/common/func.is-ng-module-def-with-providers'; export * from './lib/common/func.is-ng-type'; export { Mock } from './lib/common/mock'; export { MockControlValueAccessor, MockValidator } from './lib/common/mock-control-value-accessor'; diff --git a/tests/issue-197/with-providers.spec.ts b/tests/issue-197/with-providers.spec.ts index 569329e8ab..6f2a0a0713 100644 --- a/tests/issue-197/with-providers.spec.ts +++ b/tests/issue-197/with-providers.spec.ts @@ -1,10 +1,6 @@ import { Component, Injectable, NgModule } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { - MockBuilder, - MockRender, - NgModuleWithProviders, -} from 'ng-mocks'; +import { MockBuilder, MockRender } from 'ng-mocks'; @Injectable() class DependencyService { @@ -17,7 +13,7 @@ class DependencyService { @NgModule({}) class DependencyModule { - public static withProviders(): NgModuleWithProviders { + public static withProviders() { return { ngModule: DependencyModule, providers: [ diff --git a/tests/issue-271/test.spec.ts b/tests/issue-271/test.spec.ts index 20c79329a2..340f567f39 100644 --- a/tests/issue-271/test.spec.ts +++ b/tests/issue-271/test.spec.ts @@ -1,9 +1,5 @@ import { Injectable, NgModule } from '@angular/core'; -import { - MockBuilder, - MockRender, - NgModuleWithProviders, -} from 'ng-mocks'; +import { MockBuilder, MockRender } from 'ng-mocks'; @Injectable() class TargetService { @@ -12,7 +8,7 @@ class TargetService { @NgModule() class TargetModule { - public static forRoot(): NgModuleWithProviders { + public static forRoot() { return { ngModule: TargetModule, providers: [TargetService], diff --git a/tests/issue-312/test.spec.ts b/tests/issue-312/test.spec.ts index 694123c359..3010ffaaab 100644 --- a/tests/issue-312/test.spec.ts +++ b/tests/issue-312/test.spec.ts @@ -8,11 +8,7 @@ import { VERSION, } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { - MockBuilder, - MockRender, - NgModuleWithProviders, -} from 'ng-mocks'; +import { MockBuilder, MockRender } from 'ng-mocks'; // Because of A5 we need to cast Injectable to any type. // But because of A10+ we need to do it via a middle function. @@ -39,7 +35,7 @@ class ProvidedService { @NgModule() class ServiceModule { - public static forRoot(): NgModuleWithProviders { + public static forRoot() { return { ngModule: ServiceModule, providers: [ProvidedService], diff --git a/tests/issue-589/test.spec.ts b/tests/issue-589/test.spec.ts index db4e2d58dc..d82e67b6f1 100644 --- a/tests/issue-589/test.spec.ts +++ b/tests/issue-589/test.spec.ts @@ -1,16 +1,11 @@ import { InjectionToken, NgModule } from '@angular/core'; -import { - MockBuilder, - MockRender, - ngMocks, - NgModuleWithProviders, -} from 'ng-mocks'; +import { MockBuilder, MockRender, ngMocks } from 'ng-mocks'; const TOKEN = new InjectionToken('TOKEN'); @NgModule() class TargetModule { - public static forRoot(): NgModuleWithProviders { + public static forRoot() { return { ngModule: TargetModule, providers: [ diff --git a/tests/issue-625/test.spec.ts b/tests/issue-625/test.spec.ts index a2c57f002d..5471791367 100644 --- a/tests/issue-625/test.spec.ts +++ b/tests/issue-625/test.spec.ts @@ -5,12 +5,7 @@ import { OnInit, } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { - MockBuilder, - MockInstance, - MockRender, - NgModuleWithProviders, -} from 'ng-mocks'; +import { MockBuilder, MockInstance, MockRender } from 'ng-mocks'; /* * As you can see, SomeService provided in forRoot() function. @@ -41,7 +36,7 @@ export class AnotherService { imports: [], }) export class SomeModule { - public static forRoot(): NgModuleWithProviders { + public static forRoot() { return { ngModule: SomeRootModule, providers: [SomeService, AnotherService], diff --git a/tests/issue-762/module.spec.ts b/tests/issue-762/module.spec.ts index 736a2c2642..1015c9d6e4 100644 --- a/tests/issue-762/module.spec.ts +++ b/tests/issue-762/module.spec.ts @@ -1,9 +1,5 @@ import { Injectable, NgModule } from '@angular/core'; -import { - MockBuilder, - MockRender, - NgModuleWithProviders, -} from 'ng-mocks'; +import { MockBuilder, MockRender } from 'ng-mocks'; @Injectable() class TargetService { @@ -12,7 +8,7 @@ class TargetService { @NgModule() class TargetModule { - public static forRoot(): NgModuleWithProviders { + public static forRoot() { return { ngModule: TargetModule, providers: [TargetService],