Onto sprint planning the next day I was seemingly done with the API at this stage so I was to move onto unit testing for the front-end angular project, Angular2 comes with Jasmine and Karma built in for unit testing so that was handy.
Above is a snippet of a unit test I constructed, thankfully I got at least this done before we went on our two week break. There proved to be quite a learning curve when it came to unit testing the angular project, I suspect this may have been due to me not having worked in the front end previously and also because I was writing tests for code that I was not familiar with at all. The main pain point here proved to be in the services that relied on HTTP responses from API's. In order to test the service in isolation I had to fake the HTTP response so that the test did not rely on any code outside the service. I tried quite hard to get me head around this but didn't manage to before we headed off on the two week break.
We will see if I am to continue with unit testing when I return or if there is something of higher priority.
I am certainly welcoming the break which will allow me to catch-up on the elective class I am taking alongside the project.
No comments:
Post a Comment