11import { join } from 'node:path' ;
22import {
3- TestStack ,
43 invokeFunction ,
4+ TestStack ,
55} from '@aws-lambda-powertools/testing-utils' ;
66import {
77 CloudWatchClient ,
@@ -10,7 +10,7 @@ import {
1010import { afterAll , beforeAll , describe , expect , it } from 'vitest' ;
1111import { getMetrics , sortDimensions } from '../helpers/metricsUtils.js' ;
1212import { MetricsTestNodejsFunction } from '../helpers/resources.js' ;
13- import { RESOURCE_NAME_PREFIX , commonEnvironmentVars } from './constants.js' ;
13+ import { commonEnvironmentVars , RESOURCE_NAME_PREFIX } from './constants.js' ;
1414
1515describe ( 'Metrics E2E tests, basic features decorator usage' , ( ) => {
1616 const testStack = new TestStack ( {
@@ -92,7 +92,7 @@ describe('Metrics E2E tests, basic features decorator usage', () => {
9292
9393 // Check coldstart metric value
9494 const adjustedStartTime = new Date ( startTime . getTime ( ) - 60 * 1000 ) ;
95- const endTime = new Date ( new Date ( ) . getTime ( ) + 60 * 1000 ) ;
95+ const endTime = new Date ( Date . now ( ) + 60 * 1000 ) ;
9696 const coldStartMetricStat = await cloudwatchClient . send (
9797 new GetMetricStatisticsCommand ( {
9898 Namespace : expectedNamespace ,
@@ -150,7 +150,7 @@ describe('Metrics E2E tests, basic features decorator usage', () => {
150150
151151 // Check coldstart metric value
152152 const adjustedStartTime = new Date ( startTime . getTime ( ) - 3 * 60 * 1000 ) ;
153- const endTime = new Date ( new Date ( ) . getTime ( ) + 60 * 1000 ) ;
153+ const endTime = new Date ( Date . now ( ) + 60 * 1000 ) ;
154154 const metricStat = await cloudwatchClient . send (
155155 new GetMetricStatisticsCommand ( {
156156 Namespace : expectedNamespace ,
0 commit comments