Skip to content

Commit 742b12d

Browse files
committed
chore: format tracer package
1 parent f1c6903 commit 742b12d

File tree

11 files changed

+25
-27
lines changed

11 files changed

+25
-27
lines changed

packages/tracer/src/Tracer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if (
1010
) {
1111
process.env.AWS_XRAY_CONTEXT_MISSING = 'IGNORE_ERROR';
1212
}
13+
1314
import { Utility } from '@aws-lambda-powertools/commons';
1415
import type {
1516
AsyncHandler,
@@ -34,6 +35,7 @@ import type {
3435
TracerInterface,
3536
TracerOptions,
3637
} from './types/Tracer.js';
38+
3739
const { Subsegment: XraySubsegment } = xraySdk;
3840

3941
/**

packages/tracer/src/provider/ProviderService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {
66
HttpSubsegment,
77
ProviderServiceInterface,
88
} from '../types/ProviderService.js';
9+
910
const {
1011
captureAWS,
1112
captureAWSClient,
@@ -21,6 +22,7 @@ const {
2122
setDaemonAddress,
2223
setLogger,
2324
} = xraySdk;
25+
2426
import { subscribe } from 'node:diagnostics_channel';
2527
import http from 'node:http';
2628
import https from 'node:https';

packages/tracer/src/types/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export type {
2-
TracerOptions,
2+
AnyClass,
3+
AnyClassMethod,
34
CaptureLambdaHandlerOptions,
45
CaptureMethodOptions,
56
HandlerMethodDecorator,
6-
AnyClass,
7-
AnyClassMethod,
87
MethodDecorator,
98
TracerInterface,
9+
TracerOptions,
1010
} from './Tracer.js';

packages/tracer/tests/e2e/decorator.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import { join } from 'node:path';
22
import { TestStack } from '@aws-lambda-powertools/testing-utils';
33
import { TestDynamodbTable } from '@aws-lambda-powertools/testing-utils/resources/dynamodb';
44
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda';
5+
import type { EnrichedXRayTraceDocumentParsed } from '@aws-lambda-powertools/testing-utils/types';
56
import { getTraces } from '@aws-lambda-powertools/testing-utils/utils/xray-traces';
6-
import type { EnrichedXRayTraceDocumentParsed } from 'packages/testing/lib/cjs/types.js';
77
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
88
import { invokeAllTestCases } from '../helpers/invokeAllTests.js';
99
import {
10-
RESOURCE_NAME_PREFIX,
1110
EXPECTED_ANNOTATION_KEY as expectedCustomAnnotationKey,
1211
EXPECTED_ANNOTATION_VALUE as expectedCustomAnnotationValue,
1312
EXPECTED_ERROR_MESSAGE as expectedCustomErrorMessage,
1413
EXPECTED_METADATA_KEY as expectedCustomMetadataKey,
1514
EXPECTED_METADATA_VALUE as expectedCustomMetadataValue,
1615
EXPECTED_RESPONSE_VALUE as expectedCustomResponseValue,
1716
EXPECTED_SUBSEGMENT_NAME as expectedCustomSubSegmentName,
17+
RESOURCE_NAME_PREFIX,
1818
} from './constants.js';
1919

2020
describe('Tracer E2E tests, decorator instrumentation', () => {

packages/tracer/tests/e2e/manual.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import { join } from 'node:path';
22
import { TestStack } from '@aws-lambda-powertools/testing-utils';
33
import { TestDynamodbTable } from '@aws-lambda-powertools/testing-utils/resources/dynamodb';
44
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda';
5+
import type { EnrichedXRayTraceDocumentParsed } from '@aws-lambda-powertools/testing-utils/types';
56
import { getTraces } from '@aws-lambda-powertools/testing-utils/utils/xray-traces';
6-
import type { EnrichedXRayTraceDocumentParsed } from 'packages/testing/lib/cjs/types.js';
77
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
88
import { invokeAllTestCases } from '../helpers/invokeAllTests.js';
99
import {
10-
RESOURCE_NAME_PREFIX,
1110
EXPECTED_ANNOTATION_KEY as expectedCustomAnnotationKey,
1211
EXPECTED_ANNOTATION_VALUE as expectedCustomAnnotationValue,
1312
EXPECTED_ERROR_MESSAGE as expectedCustomErrorMessage,
1413
EXPECTED_METADATA_KEY as expectedCustomMetadataKey,
1514
EXPECTED_METADATA_VALUE as expectedCustomMetadataValue,
1615
EXPECTED_RESPONSE_VALUE as expectedCustomResponseValue,
16+
RESOURCE_NAME_PREFIX,
1717
} from './constants.js';
1818

1919
describe('Tracer E2E tests, manual instantiation', () => {

packages/tracer/tests/e2e/middy.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { join } from 'node:path';
22
import { TestStack } from '@aws-lambda-powertools/testing-utils';
33
import { TestDynamodbTable } from '@aws-lambda-powertools/testing-utils/resources/dynamodb';
44
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda';
5+
import type { EnrichedXRayTraceDocumentParsed } from '@aws-lambda-powertools/testing-utils/types';
56
import { getTraces } from '@aws-lambda-powertools/testing-utils/utils/xray-traces';
6-
import type { EnrichedXRayTraceDocumentParsed } from 'packages/testing/lib/cjs/types.js';
77
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
88
import { invokeAllTestCases } from '../helpers/invokeAllTests.js';
99
import {
10-
RESOURCE_NAME_PREFIX,
1110
EXPECTED_ANNOTATION_KEY as expectedCustomAnnotationKey,
1211
EXPECTED_ANNOTATION_VALUE as expectedCustomAnnotationValue,
1312
EXPECTED_ERROR_MESSAGE as expectedCustomErrorMessage,
1413
EXPECTED_METADATA_KEY as expectedCustomMetadataKey,
1514
EXPECTED_METADATA_VALUE as expectedCustomMetadataValue,
15+
RESOURCE_NAME_PREFIX,
1616
} from './constants.js';
1717

1818
describe('Tracer E2E tests, middy instrumentation', () => {

packages/tracer/tests/unit/Tracer.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import {
77
setContextMissingStrategy,
88
} from 'aws-xray-sdk-core';
99
import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest';
10-
import type { ConfigServiceInterface } from '../../src/types/ConfigServiceInterface.js';
11-
import type { ProviderServiceInterface } from '../../src/types/ProviderService.js';
1210
import { Tracer } from './../../src/index.js';
11+
import type { ConfigServiceInterface } from '../../src/types/ConfigServiceInterface.js';
1312
import type { CaptureLambdaHandlerOptions } from './../../src/types/index.js';
13+
import type { ProviderServiceInterface } from '../../src/types/ProviderService.js';
1414

1515
const createCaptureAsyncFuncMock = (
1616
provider: ProviderServiceInterface,
@@ -1028,7 +1028,7 @@ describe('Class: Tracer', () => {
10281028
);
10291029
setContextMissingStrategy(() => null);
10301030
vi.spyOn(tracer.provider, 'captureAsyncFunc').mockImplementation(
1031-
async (methodName, callBackFn) => {
1031+
async (_methodName, callBackFn) => {
10321032
await callBackFn(handlerSubsegment);
10331033
}
10341034
);
@@ -1419,7 +1419,7 @@ describe('Class: Tracer', () => {
14191419
);
14201420
setContextMissingStrategy(() => null);
14211421
vi.spyOn(tracer.provider, 'captureAsyncFunc').mockImplementation(
1422-
async (methodName, callBackFn) => {
1422+
async (_methodName, callBackFn) => {
14231423
await callBackFn(handlerSubsegment);
14241424
}
14251425
);

packages/tracer/tests/unit/middy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
setContextMissingStrategy,
99
} from 'aws-xray-sdk-core';
1010
import { afterAll, beforeEach, describe, expect, it, vi } from 'vitest';
11-
import { captureLambdaHandler } from '../../src/middleware/middy.js';
1211
import { Tracer } from './../../src/index.js';
12+
import { captureLambdaHandler } from '../../src/middleware/middy.js';
1313

1414
describe('Middy middleware', () => {
1515
const ENVIRONMENT_VARIABLES = process.env;

packages/tracer/tsconfig.cjs.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
"rootDir": "./src",
88
"tsBuildInfoFile": ".tsbuildinfo/cjs.json"
99
},
10-
"include": [
11-
"./src/**/*"
12-
]
13-
}
10+
"include": ["./src/**/*"]
11+
}

packages/tracer/tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88
"composite": true,
99
"declaration": true
1010
},
11-
"include": [
12-
"./src/**/*"
13-
]
14-
}
11+
"include": ["./src/**/*"]
12+
}

0 commit comments

Comments
 (0)