test.js 715 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Module dependencies.
  3. */
  4. var fs = require('fs');
  5. var st = require('st');
  6. var ftpd = require('ftpd');
  7. var http = require('http');
  8. var https = require('https');
  9. var getUri = require('../');
  10. var assert = require('assert');
  11. var streamToArray = require('stream-to-array');
  12. describe('get-uri', function () {
  13. describe('bad input', function () {
  14. it('should throw a TypeError when callback function is given', function () {
  15. assert.throws(function () {
  16. getUri();
  17. }, TypeError);
  18. });
  19. it('should return a TypeError when no URI is given', function (done) {
  20. getUri(null, function (err) {
  21. assert.equal(err.name, 'TypeError');
  22. done();
  23. });
  24. });
  25. });
  26. });