Skip to content

Commit 6452504

Browse files
chore(instrumentation-aws-lambda): test missing module
1 parent 81081ed commit 6452504

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

plugins/node/opentelemetry-instrumentation-aws-lambda/test/integrations/lambda-handler.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,19 @@ describe('lambda handler', () => {
10411041
});
10421042
});
10431043

1044+
describe('non-existent handler module', () => {
1045+
it('should skip instrumentation', async () => {
1046+
initializeHandler('lambda-test/callback.handle');
1047+
1048+
const handler = await lambdaLoadHandler('lambda-test/async.handler');
1049+
const result = await handler('arg', ctx);
1050+
1051+
assert.strictEqual(result, 'ok');
1052+
const spans = memoryExporter.getFinishedSpans();
1053+
assert.strictEqual(spans.length, 0);
1054+
});
1055+
});
1056+
10441057
describe('non-existent handler function', () => {
10451058
it('should skip instrumentation', async () => {
10461059
initializeHandler('lambda-test/async.handle');

0 commit comments

Comments
 (0)