Skip to content

Instantly share code, notes, and snippets.

@mikeyp
Created October 31, 2014 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyp/ce0a5e832545bb8d2af1 to your computer and use it in GitHub Desktop.
Save mikeyp/ce0a5e832545bb8d2af1 to your computer and use it in GitHub Desktop.
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