From 04535d961d79c086583c45e4b0cd8cb931b04e96 Mon Sep 17 00:00:00 2001 From: Yongseok Kang Date: Mon, 14 Feb 2022 15:17:45 +0900 Subject: [PATCH] [#104] koa support code level visibility --- test/instrumentation/module/koa.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/instrumentation/module/koa.test.js b/test/instrumentation/module/koa.test.js index b98ecdad..ba6b98ee 100644 --- a/test/instrumentation/module/koa.test.js +++ b/test/instrumentation/module/koa.test.js @@ -11,7 +11,7 @@ const { log } = require('../../test-helper') const agent = require('../../support/agent-singleton-mock') const Koa = require('koa') const Router = require('koa-router') - +const DefaultAnnotationKey = require('../../../lib/constant/annotation-key').DefaultAnnotationKey const apiMetaService = require('../../../lib/context/api-meta-service') const MethodDescriptorBuilder = require('../../../lib/context/method-descriptor-builder') @@ -33,6 +33,9 @@ test(`${testName1} Should record request in basic route koa.test.js`, function ( ctx.body = 'ok. get' agent.callbackTraceClose((trace) => { + t.equal(trace.span.annotations[0].key, DefaultAnnotationKey.HTTP_STATUS_CODE.name, 'HTTP param key match') + t.equal(trace.span.annotations[0].value.intValue, 200, 'response status is 200') + let actualBuilder = new MethodDescriptorBuilder('koa', 'get') .setParameterDescriptor('(ctx, next)') .setLineNumber(32)