Skip to content

Commit

Permalink
fix(MockBuilder): type of TestBed #3466
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Aug 28, 2022
1 parent ce05d37 commit 6d8cef7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libs/ng-mocks/src/lib/mock-builder/mock-builder.promise.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Provider } from '@angular/core';
import { TestBed, TestModuleMetadata } from '@angular/core/testing';
import { TestBed, TestBedStatic, TestModuleMetadata } from '@angular/core/testing';

import { flatten, mapValues } from '../common/core.helpers';
import { Type } from '../common/core.types';
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface MockBuilderPromise {
}

export class MockBuilderPromise implements IMockBuilder {
protected beforeCC: Set<(testBed: typeof TestBed) => void> = new Set();
protected beforeCC: Set<(testBed: TestBedStatic) => void> = new Set();
protected configDef: BuilderData['configDef'] = new Map();
protected defProviders: BuilderData['defProviders'] = new Map();
protected defValue: BuilderData['defValue'] = new Map();
Expand All @@ -61,7 +61,7 @@ export class MockBuilderPromise implements IMockBuilder {
}
}

public beforeCompileComponents(callback: (testBed: typeof TestBed) => void): this {
public beforeCompileComponents(callback: (testBed: TestBedStatic) => void): this {
this.beforeCC.add(callback);

return this;
Expand Down
6 changes: 3 additions & 3 deletions libs/ng-mocks/src/lib/mock-builder/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { InjectionToken, PipeTransform, Provider } from '@angular/core';
import { TestBed, TestModuleMetadata } from '@angular/core/testing';
import { TestBedStatic, TestModuleMetadata } from '@angular/core/testing';

import { AnyType } from '../common/core.types';

/**
* The interface describes the type of the next value in MockBuilder().then().
*/
export interface IMockBuilderResult {
testBed: typeof TestBed;
testBed: TestBedStatic;
}

/**
Expand Down Expand Up @@ -115,7 +115,7 @@ export interface IMockBuilder extends Promise<IMockBuilderResult> {
*
* @see https://ng-mocks.sudo.eu/api/MockBuilder#adding-schemas
*/
beforeCompileComponents(callback: (testBed: typeof TestBed) => void): this;
beforeCompileComponents(callback: (testBed: TestBedStatic) => void): this;

/**
* .build() returns a declaration which can be used in TestBed.configureTestingModule.
Expand Down

0 comments on commit 6d8cef7

Please sign in to comment.