At the Forge - Testing JavaScript
Screw.Unit is an easy-to-understand, easy-to-use framework for testing your JavaScript code. It is not the only test system of its kind, but the fact that its syntax is reminiscent of RSpec makes it easier for people like me, who like and use RSpec, to start using it quickly. RSpec advocates also will want me to point out that Screw.Unit offers JavaScript developers the same sort of BDD that characterizes RSpec and Cucumber, focusing on the results that the user sees, rather than the internal workings.
If you have never tested your JavaScript before, there's no time like the present to begin! If nothing else, you want to be sure that clicking on various parts of your HTML page does not lead to errors.
Resources
The home page for the main version of Screw.Unit is at GitHub at github.com/nkallen/screw-unit. The documentation on that page is somewhat sparse, but it offers several examples of how to create and use Screw.Unit tests.
A small tutorial for Screw.Unit, also hosted at GitHub, is at github.com/bsiggelkow/screw-unit-tutorial. This tutorial uses the Sinatra framework for Web applications, so you need to have a copy of Ruby and the Sinatra gem for Ruby in order to get started.
There is an e-mail list for Screw.Unit users, and you can subscribe at groups.google.com/group/screw-unit.
A blog post, based on the e-mail message that showed me the importance of not using the click() method and describing in greater detail how to write better tests, is available at blog.runcoderun.com/post/177871245.
jQuery, the JavaScript library used in Screw.Unit and one you might want to explore for your own in-browser applications, is at jquery.org.
Reuven M. Lerner, a longtime Web/database developer and consultant, is a PhD candidate in learning sciences at Northwestern University, studying on-line learning communities. He recently returned (with his wife and three children) to their home in Modi'in, Israel, after four years in the Chicago area.
- « first
- ‹ previous
- 1
- 2
- 3
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Web Development News
Developer Poll
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development








6 hours 58 min ago
7 hours 32 min ago
8 hours 30 min ago
9 hours 21 min ago
13 hours 22 min ago
17 hours 10 min ago
17 hours 18 min ago
19 hours 32 min ago
22 hours 2 min ago
1 day 8 hours ago