How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import { fakeAsync, TestBed, tick } from '@angular/core/testing';
    
    import { CanvasComponent } from './canvas.component';
    
    describe('CanvasComponent', () => {
      beforeEach(async () => {
        await TestBed
            .configureTestingModule({
              declarations: [CanvasComponent],
            })
            .compileComponents();
      });
    
      it('should be able to generate blob data from canvas', fakeAsync(() => {
           const fixture = TestBed.createComponent(CanvasComponent);
           const canvasComp = fixture.componentInstance;
    
           fixture.detectChanges();
           expect(canvasComp.blobSize).toBe(0);
    
           tick();
           expect(canvasComp.blobSize).toBeGreaterThan(0);
         }));
    });
    Docs
  • import {configureOnce, getByTestId} from '@testing-library/testcafe'
    
    test('can be configured once in a single page load', async t => {
      await configureOnce({testIdAttribute: 'data-other-test-id'})
      await t.click(screen.getByTestId('other-id'))
    })
    Docs
  • import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
    
    import { BannerComponent } from './banner.component';
    
    describe('BannerComponent', () => {
      let component: BannerComponent;
      let fixture: ComponentFixture<BannerComponent>;
    
      beforeEach(waitForAsync(() => {
        TestBed.configureTestingModule({declarations: [BannerComponent]}).compileComponents();
      }));
    
      beforeEach(() => {
        fixture = TestBed.createComponent(BannerComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
      });
    
      it('should create', () => {
        expect(component).toBeDefined();
      });
    });
    Docs
  • TestBed
        .configureTestingModule({
          declarations: [
            AppComponent, RouterLinkDirectiveStub, BannerStubComponent, RouterOutletStubComponent,
            WelcomeStubComponent
          ]
        })
    Docs
  • TestBed
        .configureTestingModule({declarations: [DashboardHeroComponent]})
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples