From 9bdb95c9e34cef640534e5e5a1e2225a80442000 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 09 六月 2022 15:48:15 +0800 Subject: [PATCH] TODO#139894 [ footer -最下方說明與保經代合作 ] 文案修改 --- PAMapp/node_modules/object-inspect/test/err.js | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/PAMapp/node_modules/object-inspect/test/err.js b/PAMapp/node_modules/object-inspect/test/err.js index db96338..ef8b1cb 100644 --- a/PAMapp/node_modules/object-inspect/test/err.js +++ b/PAMapp/node_modules/object-inspect/test/err.js @@ -1,5 +1,7 @@ -var inspect = require('../'); var test = require('tape'); +var ErrorWithCause = require('error-cause/Error'); + +var inspect = require('../'); test('type error', function (t) { t.plan(1); @@ -14,18 +16,33 @@ cerr.message = 'whoa'; cerr['a-b'] = 5; + var withCause = new ErrorWithCause('foo', { cause: 'bar' }); + var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' }); + withCausePlus.foo = 'bar'; + var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined }); + var withEnumerableCause = new Error('foo'); + withEnumerableCause.cause = 'bar'; + var obj = [ new TypeError(), new TypeError('xxx'), aerr, berr, - cerr + cerr, + withCause, + withCausePlus, + withUndefinedCause, + withEnumerableCause ]; t.equal(inspect(obj), '[ ' + [ '[TypeError]', '[TypeError: xxx]', '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', '{ [TypeError: tuv] baz: 555 }', - '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }' + '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }', + '{ [Error: foo] [cause]: \'bar\' }', + '{ [Error: foo] [cause]: \'bar\', foo: \'bar\' }', + '{ [Error: foo] [cause]: undefined }', + '{ [Error: foo] cause: \'bar\' }' ].join(', ') + ' ]'); }); -- Gitblit v1.8.0