Skip to Main Content
Angular: instalacja i działanie.
book

Angular: instalacja i działanie.

by Shyam Seshadri
October 2018
Intermediate to advanced content levelIntermediate to advanced
318 pages
9h 9m
Polish
APN Promise
Content preview from Angular: instalacja i działanie.
226 | Rozdział 10: Testowanie jednostkowe usług
component.createStock({valid: true});
tick();
2
fixture.detectChanges();
expect(component.message)
.toEqual('Stock with code MNTS successfully created');
const messageEl = fixture.debugElement.query(
By.css('.message')).nativeElement;
expect(messageEl.textContent)
.toBe('Stock with code MNTS successfully created');
}));
});
1
Użycie
fakeAsync
zamiast
async
2
Użycie
tick()
, aby zasymulować izakończyć całe zachowanie asynchroniczne
Przekazujemy funkcję
fakeAsync
izamiast wywoływać
whenStable
mamy teraz pro-
ste wywołanie funkcji
tick()
, która wykonuje podobną pracę. Pozwala, aby kod
wygląd ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AngularJS. Szybkie wprowadzenie

AngularJS. Szybkie wprowadzenie

Shyam Seshadri, Brad Green
Programowanie w JavaScript Rusz głową!

Programowanie w JavaScript Rusz głową!

Eric Freeman, Elisabeth Robson

Publisher Resources

ISBN: 9788375413618