https://cypress.io logo
Spy for a method in Angular
# i-need-help
b
Is there a special way to create a spy on a normal method (no output)? The decription here does not seem to work in Angular https://docs.cypress.io/api/commands/spy
Copy code
cy.spy(MyComponent, 'myMethod')
Or do i need a wrapper (with
Copy code
`then`
)? I can not find any examples
f
Trying to do the same exact thing! No luck yet.
b
If i use the wrapper syntax and console.log(wrapper) i see that there are no methods included but only the class members.... So this can not work. Thats a bit hard for unit testing ....
Another question with that context: Can i spy on a Provider of my Component? When yes, how?