Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

afeld/tdd_js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test-Drive Your JavaScript

To most people building websites, writing JavaScript means copying-and-pasting a couple of jQuery snippets onto a page to get a dropdown to animate. While the proliferation of JavaScript frameworks has helped make code more organized, testing front-end code is still far from the norm. We will go through the different types of testing, how to set up a test runner, writing unit and integration tests, and refactoring code to make it testable. You will leave this talk fitter, happier, and less likely to create globals.

Demo

To play with the demo, download/clone this repository, then follow the directions below.

Jasmine / unit tests

Open demo/jasmine/SpecRunner.html in your browser. It will run the incomplete tests by default – see demo/jasmine/complete.js for the final versions.

Selenium / integration tests

The pending specs can be found in demo/selenium/browser_spec.rb. The complete version is in demo/selenium/complete_spec.rb. Requires Firefox.

bundle install
rspec demo/selenium/browser_spec.rb

See also

License

Creative Commons License
Test-Drive Your JavaScript by Aidan Feldman is licensed under a Creative Commons Attribution 4.0 International License.

About

talk: Test-Drive Your JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published