Skip to content

Commit

Permalink
fix(core): removing isNgModuleDefWithProviders from exports #2173
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Apr 3, 2022
1 parent 5040b29 commit 7501dc9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 39 deletions.
1 change: 0 additions & 1 deletion libs/ng-mocks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
8 changes: 2 additions & 6 deletions tests/issue-197/with-providers.spec.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -17,7 +13,7 @@ class DependencyService {

@NgModule({})
class DependencyModule {
public static withProviders(): NgModuleWithProviders<DependencyModule> {
public static withProviders() {
return {
ngModule: DependencyModule,
providers: [
Expand Down
8 changes: 2 additions & 6 deletions tests/issue-271/test.spec.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -12,7 +8,7 @@ class TargetService {

@NgModule()
class TargetModule {
public static forRoot(): NgModuleWithProviders<TargetModule> {
public static forRoot() {
return {
ngModule: TargetModule,
providers: [TargetService],
Expand Down
8 changes: 2 additions & 6 deletions tests/issue-312/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -39,7 +35,7 @@ class ProvidedService {

@NgModule()
class ServiceModule {
public static forRoot(): NgModuleWithProviders {
public static forRoot() {
return {
ngModule: ServiceModule,
providers: [ProvidedService],
Expand Down
9 changes: 2 additions & 7 deletions tests/issue-589/test.spec.ts
Original file line number Diff line number Diff line change
@@ -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<TargetModule> {
public static forRoot() {
return {
ngModule: TargetModule,
providers: [
Expand Down
9 changes: 2 additions & 7 deletions tests/issue-625/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -41,7 +36,7 @@ export class AnotherService {
imports: [],
})
export class SomeModule {
public static forRoot(): NgModuleWithProviders<SomeRootModule> {
public static forRoot() {
return {
ngModule: SomeRootModule,
providers: [SomeService, AnotherService],
Expand Down
8 changes: 2 additions & 6 deletions tests/issue-762/module.spec.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -12,7 +8,7 @@ class TargetService {

@NgModule()
class TargetModule {
public static forRoot(): NgModuleWithProviders<TargetModule> {
public static forRoot() {
return {
ngModule: TargetModule,
providers: [TargetService],
Expand Down

0 comments on commit 7501dc9

Please sign in to comment.