Put in order · Angular course · Module 11: Testing

Order of a fakeAsync test with tick

Arrange the steps of a debounce test in fakeAsync (top to bottom):

Items to put in order

  • tick(300);
  • expect(spy).toHaveBeenCalledWith('samurai');
  • component.onSearchChange('samurai');
  • const spy = spyOn(component, 'performSearch');

You can check the correct answer by solving this task in the CodeWorlds game.