Skip to content

Instantly share code, notes, and snippets.

@grantmacken
Created January 24, 2016 01:02
Show Gist options
  • Save grantmacken/4b001d1f4387ba90f80b to your computer and use it in GitHub Desktop.
Save grantmacken/4b001d1f4387ba90f80b to your computer and use it in GitHub Desktop.
tap tests phridge with tape invoked with prove
#!/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