.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ć izakończyć całe zachowanie asynchroniczne
Przekazujemy funkcję
fakeAsync
izamiast 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.