Skip to content

Instantly share code, notes, and snippets.

@mikeyp mikeyp/test.js
Created Oct 31, 2014

Embed
What would you like to do?
mikey-p ~/git/example-com-cookie (master *): mocha
Example.com cookie
tests
✓ should return a 200 status when loading the test page (5015ms)
✓ should have the correct title (5008ms)
2 passing (10s)
var assert = require('assert');
var Browser = require('zombie');
// We call our test example.com
Browser.localhost('localhost', 4000);
// Load the page from localhost
var browser = Browser.create();
describe('Example.com cookie', function(){
this.timeout(10000);
describe('tests', function(){
it('should return a 200 status when loading the test page', function(done){
browser.visit('/', function (error) {
assert.ifError(error);
browser.assert.status(200);
done();
});
});
it('should have the correct title', function(done) {
browser.visit('/', function (error) {
assert.ifError(error);
browser.assert.text('h1', 'Example.com Cookie Test');
done();
});
});
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.