DotnetMinorNotes

Handige pipes

Ng attributes

ng-(un)touched ng-dirty / ng-pristine

template reference variable

<form #ding>

Unit testen

Jasmine syntax

describe('Pipe: Euro', () => {
    let euro: EuroPipe;
    
    beforeEach(() => {
        euro = new EuroPipe();
    })
    
    it('should convert numbers to euros', () => {
        expect(euro.transform(123.00)).toBe('\u20AC 123,00');
    });

    it('should handle undefined gracefully', () => {
        expect(euro.transform(undefined)).toBe(undefined);
    });
});

Assertions

Wanneer niet

Test runner runnen

ng test

Naming

Test name

{name}.spec.ts