Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #88 from stripe/travis
Browse files Browse the repository at this point in the history
Add jsdom to fix failing tests
  • Loading branch information
kyleconroy committed May 19, 2014
2 parents 25a0132 + b385cf1 commit 71595ac
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "0.10"
4 changes: 2 additions & 2 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ task 'watch', 'Watch src/ for changes', ->
print data.toString()

task 'test', 'Run tests', ->
mocha = spawn 'mocha', ['--compilers', 'coffee:coffee-script']
mocha = spawn 'mocha', ['--compilers', 'coffee:coffee-script/register']
mocha.stderr.on 'data', (data) ->
process.stderr.write data.toString()
mocha.stdout.on 'data', (data) ->
print data.toString()
print data.toString()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# jQuery.payment
# jQuery.payment [![Build Status](https://travis-ci.org/stripe/jquery.payment.svg?branch=master)](https://travis-ci.org/stripe/jquery.payment)

A general purpose library for building credit card forms, validating inputs and formatting numbers.

Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "cake test"
},
"repository": {
"type": "git",
Expand All @@ -23,5 +23,11 @@
"license": "MIT",
"dependencies": {
"jquery": "latest"
},
"devDependencies": {
"jsdom": "*",
"cake": "*",
"coffee-script": "*",
"mocha": "*"
}
}
3 changes: 3 additions & 0 deletions test/index.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
assert = require('assert')
jsdom = require('jsdom').jsdom
doc = jsdom('')
global.window = doc.createWindow()
$ = require('jquery')
global.jQuery = $

Expand Down

0 comments on commit 71595ac

Please sign in to comment.