I’ve used AngularJS for a few months, but I have no knowledge when it comes to testing AngularJS apps. I have a subscription to PluralSight.com and wanted to go through their online video training course for AngularJS. Specifically with this course I want to learn how to use Karma to do testing.
I’m usually extremely happy with PluralSight.com course, but in the beginning of this course I was somewhat disappointed. In Section 7 (“Angular Seed”) new technologies were introduced. The author introduced Angular-Seed, Node.js and Karma. I’ve worked with Node.js, but there are probably many people who have never used it. I believe the author took for granted that the student knew Node.js. For those who have never used Node.js this could be an obstacle.
When I started the course I didn’t have Node.js installed. I installed Node.js and things didn’t work as intended. I couldn’t run tests in Node.js because Karma was not installed. Once I installed Karma, Chrome wouldn’t launch in the tests.
With all the issues I was having, I wondered if others were having the same problems. If others were having similar issues, were they discouraged and not continuing with the course. So I decided to create this blog post to help others to get stared with AngularJS, Angular-Seed, Node.js and Karma.
Here are my assumptions:
- You are a windows developer
- Google Chrome browser is installed
- You will use the Windows Command Prompt instead of Bash
- You have little or no knowledge of Node.js
- You have little or no knowledge of Karma
- You will use Node.js as the web server. I will step you through this.
- You have access to and IDE. Visual Studio will be fine. NotePad++ would also probably work. I use JetBrains WebStorm. JetBrains has a free 30 day trial for WebStorm.
Here are the high level step we will follow:
- Download and install Angular-Seed
- Download and install JetBrains WebStorm (Optional)
- Download and install Node.js
- Confirm Node.js is installed
- Run Karma Unit Tests – will fail because Karma is not installed
- Install Karma
- Run Karma Unit Tests again – Will fail because Chrome will not start
- Add System Variable to Windows
- Confirm System Variable Were Added
- Run Unit Tests again – should succeed
- Confirm that Units are being tracked by Karma
- Start Web Server by using Node.js
Continue reading “Setting-up AngularJS, Angular Seed, Node.js and Karma”
I’ve been meaning to do this for a good while. I have a tendency to rebuild my PC every once in a while, and its seems I can never remember all the thing that I have downloaded, installed, and configured. So I will use this as a living log of the software, tools and configuration that I believe are beneficial to me.
- paint.net– Is a free image and photo editing software for Windows
- Notepad++– Is a free source code editor and Notepad replacement that supports several languages.
Gizmo– Is an free tool that mounts DVD ISOs and has other cool stuff
- VirtualCloneDrive – Is a free tool that mounts CD/DVD iso files. Not bloated with other features.
- System Information for Windows – Is an free advanced System Information for Windows tool that gathers detailed information about your system properties and settings and displays it in an extremely comprehensible manner.
- Disk2vhd – This tool allows you to create a snapshot of your current environment and store it as a VHD. I use this to back-up environments. After the VHD is created I can then attached the file as a drive.
- Actual Multiple Monitors – Provides taskbars on each monitor. There is a free version and a pro (paid) verson. The free verision does not expire and provides the features I need. Update: I liked this product so much, I decided to purchase it.
- Snag It – This is a great tool for screen capture.
- FreeFileSync – FreeFileSync is a folder comparison and synchronization tool providing highly optimized performance and usability without a needlessly complex user interface.
- SSMS Tools – Is an free add-in for Microsoft SQL Server Management Studio (SSMS) 2005, 2008, 2008 R2, 2011 (Denali) CTP1 and their respective Express versions.
It contains a few upgrades to the SSMS IDE that I thought were missing.
- PoorMansTSqlFormatter – This is a plugin for NotePad++. It does very simple formatting for SQL scripts. It’s nothing great but it works.
- Fiddler– Is a free Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and “fiddle” with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.
- LINQPad – This tools does a lot. If you use LINQ then this tool is a must. There is a free version, but I liked this tool so much I purchased the Premium version.
- IIS – Bit Rate Throttling – I’m using this to throttle bandwidth for an IIS website. This allows me to test on my local network how a slow connection would work.