Skip to content

Commit 87070d3

Browse files
committed
test: use member variable in e2e tests
1 parent 559ba6f commit 87070d3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Diff for: packages/tracer/tests/e2e/allFeatures.decorator.test.functionCode.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const tracer = new Tracer({ serviceName: serviceName });
3636
const dynamoDBv3 = tracer.captureAWSv3Client(new DynamoDBClient({}));
3737

3838
export class MyFunctionWithDecorator {
39+
private readonly returnValue: string;
40+
41+
public constructor() {
42+
this.returnValue = customResponseValue;
43+
}
44+
3945
@tracer.captureLambdaHandler()
4046
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4147
// @ts-ignore
@@ -77,7 +83,7 @@ export class MyFunctionWithDecorator {
7783
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
7884
// @ts-ignore
7985
public myMethod(): string {
80-
return customResponseValue;
86+
return this.returnValue;
8187
}
8288
}
8389

Diff for: packages/tracer/tests/e2e/asyncHandler.decorator.test.functionCode.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const tracer = new Tracer({ serviceName: serviceName });
3636
const dynamoDBv3 = tracer.captureAWSv3Client(new DynamoDBClient({}));
3737

3838
export class MyFunctionWithDecorator {
39+
private readonly returnValue: string;
40+
41+
public constructor() {
42+
this.returnValue = customResponseValue;
43+
}
44+
3945
@tracer.captureLambdaHandler()
4046
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4147
// @ts-ignore
@@ -72,7 +78,7 @@ export class MyFunctionWithDecorator {
7278
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
7379
// @ts-ignore
7480
public myMethod(): string {
75-
return customResponseValue;
81+
return this.returnValue;
7682
}
7783
}
7884

0 commit comments

Comments
 (0)