Ohm-Management - Projektarbeit B-ME
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.

test.js 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. var assert = require('tap');
  2. var t = require('./lib/util');
  3. assert.equal(t.isArray([]), true);
  4. assert.equal(t.isArray({}), false);
  5. assert.equal(t.isBoolean(null), false);
  6. assert.equal(t.isBoolean(true), true);
  7. assert.equal(t.isBoolean(false), true);
  8. assert.equal(t.isNull(null), true);
  9. assert.equal(t.isNull(undefined), false);
  10. assert.equal(t.isNull(false), false);
  11. assert.equal(t.isNull(), false);
  12. assert.equal(t.isNullOrUndefined(null), true);
  13. assert.equal(t.isNullOrUndefined(undefined), true);
  14. assert.equal(t.isNullOrUndefined(false), false);
  15. assert.equal(t.isNullOrUndefined(), true);
  16. assert.equal(t.isNumber(null), false);
  17. assert.equal(t.isNumber('1'), false);
  18. assert.equal(t.isNumber(1), true);
  19. assert.equal(t.isString(null), false);
  20. assert.equal(t.isString('1'), true);
  21. assert.equal(t.isString(1), false);
  22. assert.equal(t.isSymbol(null), false);
  23. assert.equal(t.isSymbol('1'), false);
  24. assert.equal(t.isSymbol(1), false);
  25. assert.equal(t.isSymbol(Symbol()), true);
  26. assert.equal(t.isUndefined(null), false);
  27. assert.equal(t.isUndefined(undefined), true);
  28. assert.equal(t.isUndefined(false), false);
  29. assert.equal(t.isUndefined(), true);
  30. assert.equal(t.isRegExp(null), false);
  31. assert.equal(t.isRegExp('1'), false);
  32. assert.equal(t.isRegExp(new RegExp()), true);
  33. assert.equal(t.isObject({}), true);
  34. assert.equal(t.isObject([]), true);
  35. assert.equal(t.isObject(new RegExp()), true);
  36. assert.equal(t.isObject(new Date()), true);
  37. assert.equal(t.isDate(null), false);
  38. assert.equal(t.isDate('1'), false);
  39. assert.equal(t.isDate(new Date()), true);
  40. assert.equal(t.isError(null), false);
  41. assert.equal(t.isError({ err: true }), false);
  42. assert.equal(t.isError(new Error()), true);
  43. assert.equal(t.isFunction(null), false);
  44. assert.equal(t.isFunction({ }), false);
  45. assert.equal(t.isFunction(function() {}), true);
  46. assert.equal(t.isPrimitive(null), true);
  47. assert.equal(t.isPrimitive(''), true);
  48. assert.equal(t.isPrimitive(0), true);
  49. assert.equal(t.isPrimitive(new Date()), false);
  50. assert.equal(t.isBuffer(null), false);
  51. assert.equal(t.isBuffer({}), false);
  52. assert.equal(t.isBuffer(new Buffer(0)), true);