How to use the ng-mocks.MockPipe 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 intershop / intershop-pwa / src / app / shell / header / containers / mini-basket / mini-basket.container.spec.ts View on Github external
beforeEach(async(() => {
    checkoutFacade = mock(CheckoutFacade);
    TestBed.configureTestingModule({
      declarations: [
        MiniBasketContainerComponent,
        MockComponent(FaIconComponent),
        MockComponent(ProductImageComponent),
        MockPipe(ProductRoutePipe),
        PricePipe,
      ],
      imports: [RouterTestingModule, TranslateModule.forRoot()],
      providers: [
        {
          provide: CheckoutFacade,
          useFactory: () => instance(checkoutFacade),
        },
      ],
    }).compileComponents();
  }));
github intershop / intershop-pwa / src / app / pages / category / category-navigation / category-navigation.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [RouterTestingModule],
      declarations: [CategoryNavigationComponent, MockPipe(CategoryRoutePipe)],
    })
      .compileComponents()
      .then(() => {
        fixture = TestBed.createComponent(CategoryNavigationComponent);
        component = fixture.componentInstance;
        element = fixture.nativeElement;

        const tree = categoryTree([
          { uniqueId: 'A', categoryPath: ['A'] },
          { uniqueId: 'A.1', categoryPath: ['A', 'A.1'] },
        ] as Category[]);
        component.category = createCategoryView(tree, 'A');
      });
  }));
github intershop / intershop-pwa / src / app / pages / checkout-shipping / checkout-shipping / checkout-shipping.component.spec.ts View on Github external
class DummyComponent {}

    TestBed.configureTestingModule({
      declarations: [
        CheckoutShippingComponent,
        DummyComponent,
        MockComponent(BasketAddressSummaryComponent),
        MockComponent(BasketCostSummaryComponent),
        MockComponent(BasketItemsSummaryComponent),
        MockComponent(BasketValidationResultsComponent),
        MockComponent(ContentIncludeComponent),
        MockComponent(ErrorMessageComponent),
        MockComponent(FaIconComponent),
        MockComponent(ModalDialogLinkComponent),
        MockComponent(NgbPopover),
        MockPipe(PricePipe),
      ],
      imports: [
        ReactiveFormsModule,
        RouterTestingModule.withRoutes([{ path: 'checkout/payment', component: DummyComponent }]),
        TranslateModule.forRoot(),
      ],
    }).compileComponents();
  }));
github intershop / intershop-pwa / src / app / shared / basket / components / line-item-list / line-item-list.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        LineItemListComponent,
        MockComponent(BasketPromotionContainerComponent),
        MockComponent(FaIconComponent),
        MockComponent(InputComponent),
        MockComponent(LineItemDescriptionComponent),
        MockComponent(ProductImageComponent),
        MockComponent(PromotionDetailsComponent),
        MockPipe(PricePipe),
        MockPipe(ProductRoutePipe),
      ],
      imports: [ReactiveFormsModule, RouterTestingModule, TranslateModule.forRoot()],
    }).compileComponents();
  }));
github Ismaestro / angular8-example-app / src / app / shared / components / search-bar / search-bar.component.spec.ts View on Github external
configureTestSuite(() => {
    TestBed.configureTestingModule({
      imports: [
        ReactiveFormsModule,
        RouterTestingModule,
        NoopAnimationsModule,
        MatAutocompleteModule,
        MatFormFieldModule,
        MatInputModule
      ],
      declarations: [
        MockPipe(CapitalizeFirstPipe),
        SearchBarComponent
      ],
      providers: [
        {provide: HeroService, useValue: heroServiceSpy},
        {provide: ROUTES_CONFIG, useValue: RoutesConfig}
      ]
    });
  });
github intershop / intershop-pwa / src / app / pages / checkout-payment / checkout-payment / checkout-payment.component.spec.ts View on Github external
TestBed.configureTestingModule({
      declarations: [
        CheckoutPaymentComponent,
        DummyComponent,
        MockComponent(BasketAddressSummaryComponent),
        MockComponent(BasketCostSummaryComponent),
        MockComponent(BasketItemsSummaryComponent),
        MockComponent(BasketPromotionCodeComponent),
        MockComponent(BasketValidationResultsComponent),
        MockComponent(ContentIncludeComponent),
        MockComponent(ErrorMessageComponent),
        MockComponent(FormlyForm),
        MockComponent(ModalDialogLinkComponent),
        MockComponent(NgbCollapse),
        MockComponent(PaymentConcardisCreditcardComponent),
        MockPipe(PricePipe),
      ],
      imports: [
        ReactiveFormsModule,
        RouterTestingModule.withRoutes([{ path: 'checkout/review', component: DummyComponent }]),
        TranslateModule.forRoot(),
      ],
    })
      .overrideComponent(CheckoutPaymentComponent, {
        set: { changeDetection: ChangeDetectionStrategy.Default },
      })
      .compileComponents();
  }));
github intershop / intershop-pwa / src / app / pages / account-order / account-order / account-order.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        AccountOrderComponent,
        MockComponent(AddressComponent),
        MockComponent(BasketCostSummaryComponent),
        MockComponent(FaIconComponent),
        MockComponent(InfoBoxComponent),
        MockComponent(LineItemListComponent),
        MockPipe(DatePipe),
      ],
      imports: [TranslateModule.forRoot()],
    }).compileComponents();
  }));
github intershop / intershop-pwa / src / app / shared / order / containers / order-list / order-list.container.spec.ts View on Github external
beforeEach(async(() => {
    accountFacade = mock(AccountFacade);

    TestBed.configureTestingModule({
      declarations: [
        MockComponent(AddressComponent),
        MockComponent(LoadingComponent),
        MockPipe(DatePipe),
        MockPipe(PricePipe),
        OrderListContainerComponent,
      ],
      providers: [{ provide: AccountFacade, useFactory: () => instance(accountFacade) }],
      imports: [RouterTestingModule, TranslateModule.forRoot()],
    }).compileComponents();
  }));
github intershop / intershop-pwa / src / app / shared / order / containers / order-list / order-list.container.spec.ts View on Github external
beforeEach(async(() => {
    accountFacade = mock(AccountFacade);

    TestBed.configureTestingModule({
      declarations: [
        MockComponent(AddressComponent),
        MockComponent(LoadingComponent),
        MockPipe(DatePipe),
        MockPipe(PricePipe),
        OrderListContainerComponent,
      ],
      providers: [{ provide: AccountFacade, useFactory: () => instance(accountFacade) }],
      imports: [RouterTestingModule, TranslateModule.forRoot()],
    }).compileComponents();
  }));
github T-Systems-MMS / phonebook / Phonebook.Frontend / src / app / shared / components / user / user-small-card / user-small-card.component.spec.ts View on Github external
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [TestComponentWrapper, UserSmallCardComponent, MockPipe(TelephonePipe, (...args) => args[0])],
      schemas: [NO_ERRORS_SCHEMA]
    }).compileComponents();
  }));

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