1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to mock router in angular jasmine spec

Discussão em 'Angular' iniciado por user11819144, Julho 10, 2025.

  1. user11819144

    user11819144 Guest

    I am new to writing test specs using jasmine. I have a condition in ngOnInit() something like, router.url.includes(some string). The default spec test case which checks component to be truthy is getting failed saying TypeError: Cannot find includes of undefined. Is there any way to spy or mock includes?

    Continue reading...

Compartilhe esta Página