From f9ebae8269ef12ebc46cd5ada6d645cb9a96b5ae Mon Sep 17 00:00:00 2001 From: Yongseok Kang <616895+feelform@users.noreply.github.com> Date: Fri, 3 Dec 2021 22:26:48 +0900 Subject: [PATCH] [#98] error handler middleware test --- test/instrumentation/module/express.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/instrumentation/module/express.test.js b/test/instrumentation/module/express.test.js index 5a39072f..53d1c253 100644 --- a/test/instrumentation/module/express.test.js +++ b/test/instrumentation/module/express.test.js @@ -287,6 +287,12 @@ function errorHandleTest(trace, t) { t.equal(actualHandlerMethodDescriptor.type, 0, 'type') t.equal(actualHandlerMethodDescriptor.lineNumber, 157, 'line number') t.true(actualHandlerMethodDescriptor.location.endsWith('express.test.js'), 'location') + + spanEvent = trace.storage.storage[0] + t.equal(spanEvent.sequence, 2, 'sequence') + t.equal(spanEvent.depth, 3, 'spanEvent.depth') + t.equal(spanEvent.exceptionInfo.intValue, 1, 'error value') + t.true(spanEvent.exceptionInfo.stringValue.endsWith('express/lib/middleware/init.js:40:5)'), 'error case') } const testName2 = 'express2'