test-isUrl.js 661 B

12345678910111213141516171819202122232425262728
  1. var assert = require('assert')
  2. , request = require('../index')
  3. , http = require('http')
  4. ;
  5. var s = http.createServer(function(req, res) {
  6. res.statusCode = 200;
  7. res.end('');
  8. }).listen(6767, function () {
  9. // Test lowercase
  10. request('http://localhost:6767', function (err, resp, body) {
  11. // just need to get here without throwing an error
  12. assert.equal(true, true);
  13. })
  14. // Test uppercase
  15. request('HTTP://localhost:6767', function (err, resp, body) {
  16. assert.equal(true, true);
  17. })
  18. // Test mixedcase
  19. request('HtTp://localhost:6767', function (err, resp, body) {
  20. assert.equal(true, true);
  21. // clean up
  22. s.close();
  23. })
  24. })