Created
October 31, 2014 06:11
-
-
Save mikeyp/ce0a5e832545bb8d2af1 to your computer and use it in GitHub Desktop.
This file contains 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
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) |
This file contains 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
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