When setting up unit tests for a module you need to make sure that your test harness is aware of any dependancies that module has. It doesn't stop there though; you also need to make sure that you include the dependancies of your dependancies. And so it goes on. Thankfully all dependancies are injected in the same way.
A blog about coding in AngularJs, how different functionality works, and how to set up supporting technologies.
Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts
Sunday, 7 June 2015
Sunday, 17 May 2015
Set Up Tests with Jasmine
Since I've been trying to do my entire build process through Grunt I've had to rethink how testing works. Up until recently I've either been using Visual Studio plugins (Chutzpah or ReSharper) or Protractor as a macro in WebStorm. Both of these require a very specific configuration in order to run Jasmine tests. The same is true for setting up Jasmine testing in Grunt. However, what doesn't change is how to actually write the tests. Once you've got the configuration for your particular test harness setup this is how to structure tests.
Location:
United Kingdom
Sunday, 26 April 2015
Use Jasmine to Run Tests as Part of the Grunt Process
I've been using Jasmine to runt Unit tests for a while now, but I've always triggered them manually through WebStorm. This is fine as long as I remember to trigger them, which most of the time I don't. I've recently started a new project at work and have been able to define a new process as part of it. This has been a great opportunity for us to learn from the mistakes that we've previously made and think about how we can try to avoid them this time. As part of this we've decided to build our unit testing into our development process. We've set it up so that if our tests don't pass, then the code doesn't get published to the output file and therefore can't be loaded into the browser. Using watch to chain our tasks means that we know the moment we've saved our files whether or not our code works as we want it to.
Location:
United Kingdom
Subscribe to:
Posts (Atom)