You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
571 B

11 years ago
'use strict';
var assert = require('assert');
var got = require('./index');
it('should request', function (done) {
got('http://google.com', function (err, data) {
if (err) {
console.error(err);
assert(false);
return;
}
assert(/google/.test(data));
done();
});
got('https://google.com', function (err, data) {
if (err) {
console.error(err);
assert(false);
return;
}
assert(/google/.test(data));
done();
});
got('http://sindresorhus.com/sfsadfasdfadsga', function (err, data) {
assert.strictEqual(err, 404);
done();
});
11 years ago
});