public
Last active

  • Download Gist
test.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
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();
});
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.