Created
January 24, 2016 01:02
-
-
Save grantmacken/4b001d1f4387ba90f80b to your computer and use it in GitHub Desktop.
tap tests phridge with tape invoked with prove
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var test = require('tape'); | |
// var driver = require('node-phantom-simple'); | |
var properties = require('properties-parser').read('./config'); | |
var website = 'http://' + properties.NAME | |
var phridge = require("phridge"); | |
test('example tap test using phridge and tape', function (t) { | |
t.plan(1); | |
phridge.spawn().then(function(phantom) { | |
return phantom.openPage("http://example.com");}) | |
.then( | |
function(page) { | |
return page.run(function() { | |
return this.evaluate(function() { | |
return { 'title': document.title } | |
}); | |
}); | |
}) | |
.finally(phridge.disposeAll) | |
.done(function (jsn) { | |
t.equal(jsn.title, properties.NAME, 'home page document title should repo name'); | |
}, function (err) { | |
throw err; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment