"use strict";

var _tape = _interopRequireDefault(require("tape"));

var _error = require("./error");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(0, _tape.default)('serializeError', t => {
  t.equal((0, _error.serializeError)(new Error('boom!')).message, 'boom!');
  t.ok((0, _error.serializeError)(new Error('boom!')).stack.startsWith('Error: boom!\n'));
  t.equal((0, _error.serializeError)(null), null);
  t.ok((0, _error.serializeError)(new Error()).stack.startsWith('Error\n'));
  t.equal((0, _error.serializeError)(5), 5);
  t.ok((0, _error.serializeError)(new Date()) instanceof Date);
  t.end();
});