@@ -4,7 +4,7 @@ import { TestDynamodbTable } from '@aws-lambda-powertools/testing-utils/resource
4
4
import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda' ;
5
5
import type { EnrichedXRayTraceDocumentParsed } from '@aws-lambda-powertools/testing-utils/types' ;
6
6
import { getTraces } from '@aws-lambda-powertools/testing-utils/utils/xray-traces' ;
7
- import { afterAll , beforeAll , describe , expect , it } from 'vitest' ;
7
+ import { afterAll , beforeAll , describe , expect , it , vi } from 'vitest' ;
8
8
import { invokeAllTestCases } from '../helpers/invokeAllTests.js' ;
9
9
import {
10
10
EXPECTED_ANNOTATION_KEY as expectedCustomAnnotationKey ,
@@ -17,6 +17,10 @@ import {
17
17
RESOURCE_NAME_PREFIX ,
18
18
} from './constants.js' ;
19
19
20
+ vi . hoisted ( ( ) => {
21
+ process . env . AWS_PROFILE = 'aamorosi-Admin' ;
22
+ } ) ;
23
+
20
24
describe ( 'Tracer E2E tests, decorator instrumentation' , ( ) => {
21
25
const testStack = new TestStack ( {
22
26
stackNameProps : {
@@ -76,7 +80,7 @@ describe('Tracer E2E tests, decorator instrumentation', () => {
76
80
* 1. Lambda Context (AWS::Lambda)
77
81
* 2. Lambda Function (AWS::Lambda::Function)
78
82
* 4. DynamoDB (AWS::DynamoDB)
79
- * 4. Remote call (docs.powertools. aws.dev )
83
+ * 4. Remote call (docs.aws.amazon.com )
80
84
*/
81
85
expectedSegmentsCount : 4 ,
82
86
} ) ;
@@ -100,11 +104,11 @@ describe('Tracer E2E tests, decorator instrumentation', () => {
100
104
expect ( subsegments . size ) . toBe ( 3 ) ;
101
105
102
106
// Check remote call subsegment
103
- expect ( subsegments . has ( 'docs.powertools. aws.dev ' ) ) . toBe ( true ) ;
104
- const httpSubsegment = subsegments . get ( 'docs.powertools. aws.dev ' ) ;
107
+ expect ( subsegments . has ( 'docs.aws.amazon.com ' ) ) . toBe ( true ) ;
108
+ const httpSubsegment = subsegments . get ( 'docs.aws.amazon.com ' ) ;
105
109
expect ( httpSubsegment ?. namespace ) . toBe ( 'remote' ) ;
106
110
expect ( httpSubsegment ?. http ?. request ?. url ) . toEqual (
107
- 'https://docs.powertools. aws.dev/lambda /typescript/latest/'
111
+ 'https://docs.aws.amazon.com/powertools /typescript/latest/'
108
112
) ;
109
113
expect ( httpSubsegment ?. http ?. request ?. method ) . toBe ( 'GET' ) ;
110
114
expect ( httpSubsegment ?. http ?. response ?. status ) . toEqual ( expect . any ( Number ) ) ;
0 commit comments