Skip to content

Commit

Permalink
[#104] koa support code level visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
feelform committed Feb 14, 2022
1 parent 14439d3 commit 04535d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/instrumentation/module/koa.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand All @@ -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)
Expand Down

0 comments on commit 04535d9

Please sign in to comment.