How to use the ng-mocks.MockModule function in ng-mocks

To help you get started, we’ve selected a few ng-mocks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Ismaestro / angular8-example-app / src / app / modules / heroes / pages / heroes-list-page / heroes-list-page.component.spec.ts View on Github external
configureTestSuite(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule,
        FormsModule,
        ReactiveFormsModule,
        NoopAnimationsModule,
        MatListModule,
        MatIconModule,
        MatFormFieldModule,
        MatInputModule,
        MockModule(NgxScrollToFirstInvalidModule)
      ],
      declarations: [
        MockComponent(HeroRemoveComponent),
        MockComponent(LoadingPlaceholderComponent),
        HeroesListPageComponent
      ],
      providers: [
        {provide: MatSnackBar, useValue: matSnackBarSpy},
        {provide: MatDialog, useValue: matDialogSpy},
        {provide: HeroService, useValue: heroServiceSpy},
        {
          provide: I18n, useValue: () => {
          }
        },
        {provide: ROUTES_CONFIG, useValue: RoutesConfig},
        {
github ike18t / ng-mocks / examples / MockRender / MockRender.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      declarations: [
        TestedComponent,
      ],
      imports: [
        MockModule(DependencyModule),
      ],
    });
  });

ng-mocks

An Angular testing library for creating mock services, components, directives, pipes and modules in unit tests. It provides shallow rendering, precise stubs to fake child dependencies. ng-mocks works with Angular 5 6 7 8 9 10 11 12 13 14 15 16 17 18, jasm

MIT
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis