Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated Mocha and tests to make it compatible with Node v0.8

  • Loading branch information...
commit 8024eb62b3b130d9dd5d98e6d7ef3cd6db7dbfae 1 parent d383778
@paulbjensen paulbjensen authored
Showing with 43 additions and 33 deletions.
  1. +2 −2 package.json
  2. +5 −0 readme.md
  3. +36 −31 test/sanity.js
View
4 package.json
@@ -16,8 +16,8 @@
"hash_file": "0.0.x"
},
"devDependencies": {
- "mocha": "0.12.x",
+ "mocha": "1.x.x",
"soda": "0.2.x"
},
- "engines": { "node": "0.6.x" }
+ "engines": { "node": ">= 0.6.x" }
}
View
5 readme.md
@@ -10,3 +10,8 @@ require('selenium-launcher').launch(function(er, selenium) {
// selenium is a child process, so you can do selenium.kill()
})
```
+
+Testing
+---
+
+ node_modules/.bin/mocha -t 20000
View
67 test/sanity.js
@@ -1,38 +1,43 @@
var assert = require('assert')
, soda = require('soda')
- , seleniumLauncher = require('selenium-launcher')
+ , seleniumLauncher = require('../lib/selenium-launcher')
-exports['sanity'] = function(done) {
- seleniumLauncher(function(er, selenium) {
- if (er) return done(er)
- selenium.on('exit', function() { done() })
+describe("sanity", function(){
- soda.createClient({
- url: 'http://www.facebook.com/',
- host: selenium.host,
- port: selenium.port,
- })
- .chain
- .session()
- .setTimeout(5000)
- .open('/')
- .waitForPageToLoad(2000)
- .waitForTextPresent('Email')
- .assertTextPresent('Email')
- .testComplete()
- .end(function() {
+ it("should be sane", function(done){
+ seleniumLauncher(function(er, selenium) {
+ if (er) return done(er)
+ selenium.on('exit', function() { done() })
+
+ soda.createClient({
+ url: 'http://www.facebook.com/',
+ host: selenium.host,
+ port: selenium.port,
+ })
+ .chain
+ .session()
+ .setTimeout(5000)
+ .open('/')
+ .waitForPageToLoad(2000)
+ .waitForTextPresent('Email')
+ .assertTextPresent('Email')
+ .testComplete()
+ .end(function() {
+ selenium.kill()
+ })
+ })
+ });
+
+
+ it('should get the server port from the node environment', function(done) {
+ process.env.SELENIUM_LAUNCHER_PORT = '4444'
+ seleniumLauncher(function(er, selenium) {
+ delete process.env.SELENIUM_LAUNCHER_PORT
+ if (er) return done(er);
+ assert.equal(selenium.port, 4444);
+ selenium.on('exit', function() { done() })
selenium.kill()
})
- })
-}
+ });
-exports['server from environment'] = function(done) {
- process.env.SELENIUM_LAUNCHER_PORT = '4444'
- seleniumLauncher(function(er, selenium) {
- delete process.env.SELENIUM_LAUNCHER_PORT
- if (er) return done(er)
- assert.equal(selenium.port, 4444)
- selenium.on('exit', function() { done() })
- selenium.kill()
- })
-}
+});
Please sign in to comment.
Something went wrong with that request. Please try again.