Showing posts with label Grunt. Show all posts
Showing posts with label Grunt. Show all posts

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.

Sunday, 22 February 2015

Use ng-annotate with Grunt in WebStorm

After my last post on using $inject for protecting your dependancy injection against minification I did some further reading on ng-annotate. In his style guide, John Papa says that he uses $inject because it mirrors the technique used by ng-annotate, which he uses to automatically create minification safe dependancies and here is how you can too.

Sunday, 5 October 2014

Use Grunt to Minify your AngularJs Files

When my company decided to rebuild our primary product last year it allowed us devs to go crazy and attempt to implement as many best practices as possible. As part of this we wanted to use SASS so we needed something that would allow us to transpile and minify our code. As we had gone that far we thought we might as well minify our JavaScript files as well. I'm sad to say that we didn't go so far as to minify our HTML, and we didn't compress anything either. However, we did want to use a task runner that would do all this for us and so we started using Grunt.

Sunday, 28 September 2014

Setup a Windows Development Environment with Webstorm for AngularJs

Although I used Linux environments at university, I've been working in Windows environments ever since I left. I've tried working on Mac, but I find it so hard to create an environment to work in that I'm put off before I finish. I continually find myself returning to Windows, because it allows me to do the 'risky' stuff that I have the knowledge to do without patronising me (quite as much as Mac). Still, there are things to learn when setting up an environment for web development.