151c61e7c4d11d4f71b6aaedd5da7f9b3ff3ecff90ef9fc9e92c15ac147ad9516f41da082f042a1cb9bda46d405ca8b135995455a6d5ff6800444164c68805 920 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var getName = require('../');
  3. var test = require('tape');
  4. var runTests = require('./tests');
  5. test('as a function', function (t) {
  6. t.test('non-functions', function (st) {
  7. st['throws'](function () { getName(); }, TypeError, 'undefined is not a function');
  8. st['throws'](function () { getName(null); }, TypeError, 'null is not a function');
  9. st['throws'](function () { getName(true); }, TypeError, 'true is not a function');
  10. st['throws'](function () { getName(false); }, TypeError, 'false is not a function');
  11. st['throws'](function () { getName('foo'); }, TypeError, '"foo" is not a function');
  12. st['throws'](function () { getName([]); }, TypeError, '[] is not a function');
  13. st['throws'](function () { getName({}); }, TypeError, '{} is not a function');
  14. st['throws'](function () { getName(/a/g); }, TypeError, '/a/g is not a function');
  15. st.end();
  16. });
  17. runTests(getName, t);
  18. t.end();
  19. });