Skip to content

A test harness for Javascript using Gulp, Karma, Jasmine and Phantom.js

Notifications You must be signed in to change notification settings

codelusion/js-test-harness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##js-test-harness

###A test harness for Javascript using Gulp, Karma, Jasmine and Phantom.js

While setting up a test harness for an enterprise SaaS application with a largely untested Javascript codebase, I had to pull together information from a lot of different sources.

I was looking to do the following:

  • Setup Karma for TDD
  • Setup Karma for a CI/Build Server (Jenkins) using PhantomJS
  • Setup test filters via commandline flags
  • Setup to test ajax with jQuery (i.e. the ability to mock Http Requests)
  • Setup testing for jQuery with HTML injection into a spec (in cases where Javascript is coupled the DOM).

This test harness pulls together all of these.

Note: Sample code and tests relating to the Media Player is from the Jasmine standalone download: https://github.com/jasmine/jasmine/releases

###To install and run sample tests:

git clone https://github.com/codelusion/js-test-harness
npm install
gulp test
gulp test -f "text to match" //only runs tests that match phrase
gulp tdd //TDD Mode, tests are run when changes are detected

About

A test harness for Javascript using Gulp, Karma, Jasmine and Phantom.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published