Configuring Karma to test Angular apps using RequireJS

Software Development
Installing and configuring a testing environment for an Angular application hasn't been very straightforward for me but here are the steps I took (the right ones, at least). Configuring Karma First of all, we need to have installed and working: Node.js + Karma + Mocha + Chai + Sinon + Karma-RequireJs (the plugin for Karma, not the standard library). Once that works, we still need to configure it all to test our app, which is a big angular app and uses RequireJS to load its modules. First of all, we can configure Karma by executing "karma init" on the console (make sure you do that on the main folder of your project!!). That will give us a config file with the basic config done. We wanted to use Mocha, Chai…
Read More

Node.js

Software Development
Node is a javascript based server that allows to run javascript based applications in your computer without having to open or use any browser. This means that javascript applications can be run as desktop apps. You may now wonder why would anyone want to do that, but in any case, I'm not saying you have to build any JS app, actually, there are plenty of them already developed that you can benefit from, you only need to install node.js and start installing and running them. Those tools by the way, are mainly helpers to build your websites... in javascript. Which has a lot of sense, as many applications are now going into Knockout, Ember or AngularJS, which means client-side presentation apps made in javascript. So we are going to have…
Read More

Installing Node.js with Karma and Mocha for Visual Studio

Software Development
Node.js Please download the installer (.msi) from their downloads page. There's also an .exe but it didn't work very well to me. You need to install it as an admin, so open cmd as admin then go to the folder where the msi is downloaded and exec it (just write its name). That should install node. Testing that it worked Before going forward we can check that the install was successful, to test node, on the same cmd just type "node -v" and press enter, that should display its current version. You can also write just "node" to open the program. Now write "1+2" and press enter, that should output a 3. Ctrl+C to close node. (more…)
Read More

Configuring local website domain and SSL using IIS7

Software Development
Creating your website This tutorial is not really about how to add your website to IIS, but just as a quick reminder: Open IIS, expand your Computer icon, right click on "sites", click on "Add new site..." and select the folder where it's placed. Remember that if it's a .Net website you may have to set the right Framework at the App Pool. Setting a website's domain Now that we have our website running but that we need to access it using localhost or 127.0.0.1, maybe using some port to have multiple websites like :8080 or :9999, you may prefer to set a domain and get rid of the port. Select your website on the left panel, now look for the "Bindings" option on the right panel and click it,…
Read More

How to build .Net projects manually

Software Development
We can build .Net projects manually by making a call to the Microsoft's builder engine called MSBuilder.exe, which comes with Visual Studio so it should be placed around some folder there depending on the version of Visual Studio that you have. It is already integrated into Visual Studio, but if you want to call it manually you can make a call to it using a command line and sending which project to build and its options. As writing that each time we want to build would be hazardous and time-consuming it is better to create a script to do all the stuff just on executing it. This way, also, we can prepare different scripts with different types of builds: dev, staging, production, ... Here you have an example of what…
Read More

Continuous Integration Summary

Software Development
Every time that somebody commits any change, the entire application is built and a comprehensive set of automated tests is run against it. If build or tests fail, the development team stops and fixes it immediately. The goal is that the software is in a working state all the time. Check In regularly so that changes keep small and less likely to break the build. Use proper log descriptions on check ins. Never Check In a Broken Build as that breaks the continuous integration. Always run all Commit Tests Locally before Committing or get your CI (Continuous Integration) Server to do it for you. Wait for Commit Tests to pass before moving on. If commits are done frequently any crash should be a small piece to fix, if left unbroken,…
Read More