Skip to content

Instantly share code, notes, and snippets.

@joachimhs
Created March 29, 2013 15:03
Show Gist options
  • Save joachimhs/5271393 to your computer and use it in GitHub Desktop.
Save joachimhs/5271393 to your computer and use it in GitHub Desktop.
Testing
Even though JavaScript have matured significantly over the last five years, there is still a couple of areas where you will most definitely notice that you are working with a project that still have some maturing to do. Testing is definitely one of these areas, leaving a lot of the decisions required up to the application developers. This chapter will attempt to outline how you can successfully test your own Ember.js applications while looking at a real world implementation of one possible test harness.
As with applications written in other languages, there are multiple way to test your application, including:
• Unit Testing
• Integration Testing
• Performance Testing
• Regression Testing
• Black Box Testing
• Continuous Integration
Naturally, you might not need to implement a solution for all of these testing types in your own application. Chances are, though, that you might need several of them, where unit testing and integration testing are the most common types of test harnesses you will find for JavaScript applications.
Depending on what other languages and tools you have previous experience with, chances are also that you will find your JavaScript test harnesses to be significantly more involved and specialized for your application and your environment. On of the reasons for this is that the tools available to perform JavaScript Testing are rather young, another is the fact that JavaScript have changed so rapidly from a scripting language to a full featured application framework, meaning that building standardized tools to perform testing in this environment is all that much more difficult.
That said, there are definitely a light at the end of the tunnel, and we are seeing an increased focus on good testing tools for JavaScript application emerging. This chapter will take a look at a few of these, and see how some of these tools can be chained together to build up powerful test harnesses. More specifically this chapter will look into the following tools:
• QUnit for Unit Testing
• PhantomJS for both Unit Testing and Integration Testing
• Jasmine.js for Integration Testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment