tunnckoCore / ideas

:notebook: My centralized place for ideas, thoughts and todos. Raw, PoC implementations and so on... :star:
http://j.mp/1stW47C
6 stars 0 forks source link

beautify errors #8

Open tunnckoCore opened 9 years ago

tunnckoCore commented 9 years ago

this is far more useful and clean

  ✖ should return true if given `name` not exist in npm registry

    AssertionError at /home/charlike/dev/test.js: line 34, column 22-25

                               vvv
    33.   isMissing('wombat-foo-bar-baz-qux-zero-four', function _cb(err, res) {
    34.     assert.strictEqual(123, null);
    35.     assert.strictEqual(res, true);
                               ^^^

     actual: 123
   expected: null
   operator: ===
    message: 123 === null

  ✔ should return false if given `name` exist in npm registry
  ✔ should return true if given `name` not exist in npm registry

answering

tunnckoCore commented 9 years ago

YEAH, mocha tuned down the fcking stack straces

tunnckoCore commented 9 years ago

hint https://github.com/jonschlinkert/plugin-error

tunnckoCore commented 9 years ago
var PackageError = require('package-error')('my-pkg-name') // in `debug` style

var realErr = new TypeError('expect `name` to be string')
throw new PackageError(realErr, {actual: typeof name, expected: 'string'})
tunnckoCore commented 8 years ago

have process on this.. kind-error, error-format, stacktrace-metadata, error-base, useful-error.