title: How to reset a spy in Jasmine?
body: <p>I have an issue where I've set up a mock service as a spy.</p>
  
  <pre><code> mockSelectionsService = jasmine.createSpyObj(['updateSelections']);
  </code></pre>
  
  <p>I then call that stub method twice, each time in a different test. The problem is that when i <code>expect()</code> the spy with <code>.toHaveBeenCalledWith()</code> the toHaveBeenCalledWith method also contains the arguments it was passed from the first test which produces a false positive on my second test.</p>
  
  <p>How do I wipe/clear/reset the spyObject for my next test so that it no longer believes it as been called at all?</p>
  
  <p>Initialisation of services/components</p>
  
  <pre><code>  beforeEach(() =&gt; {
      mockSelectionsService = jasmine.createSpyObj(['updateSelections']);
  
      TestBed.configureTestingModule({
        declarations: [QuickSearchComponent, LoaderComponent, SearchComponent, SearchPipe, OrderByPipe],
        providers: [OrderByPipe, SearchPipe, SlicePipe, {provide: SelectionsService, useValue: mockSelectionsService}],
        imports: [FormsModule, HttpClientModule]
      });
  
  
      fixture = TestBed.createComponent(QuickSearchComponent);
      component = fixture.componentInstance;
      fixture.detectChanges();
  
      fixture.componentInstance.templates = mockTemplates;
      fixture.componentInstance.manufacturers = mockManufacturers;
    });
  </code></pre>