I've been delving into learning about unit testing with Angular.
One of the challenges I encountered involved a service method that utilizes http.get, pipes it into a map function, and returns a typed observable stream of BankAccountFull[].
Despite following the guidelines from the "Testing services" page on angular.io, I kept encountering an error message stating:
Expected $[0] to be a kind of BankAccountFull, but was Object({...}
.
I attempted typecasting within both the test's arrow function argument and the expect statement without success.
Below is the code for the service:
... // Service code omitted for brevity
And here is the unit test code snippet:
... // Unit test code omitted for brevity
Upon running the test, the summary displayed the mismatched expectations. Each item in the expected accounts list did not match the BankAccountFull structure as anticipated.