Skip to content

Instantly share code, notes, and snippets.

@ruanyl
Forked from Spoygg/test.js
Created August 16, 2014 05:10
Show Gist options
  • Save ruanyl/ed8da9d2a21fad9bc4b4 to your computer and use it in GitHub Desktop.
Save ruanyl/ed8da9d2a21fad9bc4b4 to your computer and use it in GitHub Desktop.
describe('Test example.com', function(){
before(function(done) {
client.init().url('http://example.com', done);
});
describe('Check homepage', function(){
it('should see the correct title', function(done) {
client.getTitle(function(err, title){
expect(title).to.have.string('Example Domain');
done();
});
});
it('should see the body', function(done) {
client.getText('p', function(err, p){
expect(p).to.have.string(
'for illustrative examples in documents.'
);
done();
})
});
});
after(function(done) {
client.end();
done();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment