Skip to content
Studyraft
Menu
  • About
  • Contact Us
  • Privacy Policy

toHaveBeenCalled opposite in karma

Oct 31 2022December 9, 2022

If you are looking for a method to behave the opposite of toHaveBeenCalled i.e:

expect(youServiceMock.yourmethod).toHaveBeenCalled();

you can use the following way to do that:

expect(youServiceMock.yourmethod).not.toHaveBeenCalled();

Related Posts:

  • ng test multiple karma configs
  • Show hidden files on Mac
  • How to rename a file in Ubuntu
  • Enable 2-Step Verification in Google Account
  • Karma No binary form ChromeHeadless
Oct 31 2022December 9, 2022

© 2025 Studyraft