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,YAAY,cAAc,CAAC,SAAS,CAAC,CAAA;QAC/C,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,SAAS,CAAC,CAAA;QAChC,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,YAAY,CAAC,CAAA;QAEnC,CAAC,CAAC,GAAG,EAAE,CAAA;IACT,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import test = require('blue-tape')\nimport makeErrorCause = require('./index')\n\ntest('make error cause', t => {\n const TestError = makeErrorCause('TestError')\n const SubTestError = makeErrorCause('SubTestError', TestError)\n\n t.test('render the cause', t => {\n const cause = new Error('boom!')\n const error = new TestError('something bad', cause)\n const again = new SubTestError('more bad', error)\n\n t.equal(error.cause, cause)\n t.equal(error.toString(), 'TestError: something bad\\nCaused by: Error: boom!')\n t.ok(error instanceof Error)\n t.ok(error instanceof makeErrorCause.BaseError)\n t.ok(error instanceof TestError)\n\n t.equal(again.cause, error)\n t.equal(again.toString(), 'SubTestError: more bad\\nCaused by: TestError: something bad\\nCaused by: Error: boom!')\n t.ok(again instanceof Error)\n t.ok(again instanceof makeErrorCause.BaseError)\n t.ok(again instanceof TestError)\n t.ok(again instanceof SubTestError)\n\n t.end()\n })\n})\n"]} |