refactor(testing): introduce new testing api to support ng modules
BREAKING CHANGE: - deprecations: * `withProviders`, use `TestBed.withModule` instead * `addProviders`, use `TestBed.configureTestingModule` instead * `TestComponentBuilder`, use `TestBed.configureTestModule` / `TestBed.override...` / `TestBed.createComponent` instead. Closes #10354
This commit is contained in:
@ -327,27 +327,6 @@ export function main() {
|
||||
expect(componentFixture.nativeElement).toHaveText('Mock');
|
||||
}));
|
||||
|
||||
it('should create components synchronously with a custom module',
|
||||
inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
|
||||
@Pipe({name: 'somePipe'})
|
||||
class SomePipe {
|
||||
transform(value: any) { return `transformed ${value}`; }
|
||||
}
|
||||
|
||||
@NgModule({declarations: [SomePipe]})
|
||||
class SomeModule {
|
||||
}
|
||||
|
||||
@Component({selector: 'comp', template: `{{'hello' | somePipe}}`})
|
||||
class SomeComponent {
|
||||
}
|
||||
|
||||
|
||||
let componentFixture = tcb.createSync(SomeComponent, SomeModule);
|
||||
componentFixture.detectChanges();
|
||||
expect(componentFixture.nativeElement).toHaveText('transformed hello');
|
||||
}));
|
||||
|
||||
describe('ComponentFixture', () => {
|
||||
it('should auto detect changes if autoDetectChanges is called',
|
||||
inject(
|
||||
|
Reference in New Issue
Block a user