Я делаю expect(ClassUnderTest.someMethod(withSomeParams)).toThrow()
и получаю:-
Error: <toThrow> : Actual is not a Function
Usage: expect(function() {<expectation>}).toThrow(<ErrorConstructor>, <message>)
и я не понимаю пример использования.
Я пробовал expect(() => ClassUnderTest.someMethod(withSomeParams)).toThrow()
, получил Expected function to throw an exception.
. И попробовал: -
ClassUnderTest.someMethod(withSomeParams)
.subscribe( res => res,
err => console.log(err))
и я получил Error: 1 periodic timer(s) still in the queue.
Я не понимаю, как написать это ожидание, когда выдается ошибка.