@@ -5206,135 +5206,6 @@ describe('telemetry metadata', () => {
52065206 } ) ;
52075207} ) ;
52085208
5209- // describe('NODEJS_LATEST runtime resolution', () => {
5210- // test('uses determineLatestNodeRuntime when runtime is NODEJS_LATEST', () => {
5211- // // GIVEN
5212- // const stack = new cdk.Stack();
5213-
5214- // // WHEN
5215- // const fn = new lambda.Function(stack, 'MyFunction', {
5216- // runtime: lambda.Runtime.NODEJS_LATEST,
5217- // handler: 'index.handler',
5218- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5219- // });
5220-
5221- // // THEN
5222- // // The function should use the determined runtime, not the NODEJS_LATEST token
5223- // Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
5224- // Runtime: {
5225- // 'Fn::FindInMap': [
5226- // 'LatestNodeRuntimeMap',
5227- // {
5228- // Ref: 'AWS::Region',
5229- // },
5230- // 'value',
5231- // ],
5232- // },
5233- // });
5234- // });
5235-
5236- // test('uses provided runtime when not NODEJS_LATEST', () => {
5237- // // GIVEN
5238- // const stack = new cdk.Stack();
5239-
5240- // // WHEN
5241- // const fn = new lambda.Function(stack, 'MyFunction', {
5242- // runtime: lambda.Runtime.NODEJS_18_X,
5243- // handler: 'index.handler',
5244- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5245- // });
5246-
5247- // // THEN
5248- // // The function should use the exact runtime provided
5249- // Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
5250- // Runtime: 'nodejs18.x',
5251- // });
5252- // });
5253-
5254- // test('effectiveRuntime property returns determined runtime for NODEJS_LATEST', () => {
5255- // // GIVEN
5256- // const stack = new cdk.Stack();
5257-
5258- // // WHEN
5259- // const fn = new lambda.Function(stack, 'MyFunction', {
5260- // runtime: lambda.Runtime.NODEJS_LATEST,
5261- // handler: 'index.handler',
5262- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5263- // });
5264-
5265- // // THEN
5266- // // The runtime property should return the determined runtime, not NODEJS_LATEST
5267- // expect(fn.runtime).not.toBe(lambda.Runtime.NODEJS_LATEST);
5268- // expect(fn.runtime.family).toBe(lambda.RuntimeFamily.NODEJS);
5269- // expect(fn.runtime.isVariable).toBe(true); // Should be variable since it's determined at deploy time
5270- // });
5271-
5272- // test('effectiveRuntime property returns original runtime for non-NODEJS_LATEST', () => {
5273- // // GIVEN
5274- // const stack = new cdk.Stack();
5275-
5276- // // WHEN
5277- // const fn = new lambda.Function(stack, 'MyFunction', {
5278- // runtime: lambda.Runtime.NODEJS_18_X,
5279- // handler: 'index.handler',
5280- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5281- // });
5282-
5283- // // THEN
5284- // // The runtime property should return the exact runtime provided
5285- // expect(fn.runtime).toBe(lambda.Runtime.NODEJS_18_X);
5286- // });
5287-
5288- // test('NODEJS_LATEST resolution works in different regions', () => {
5289- // // GIVEN
5290- // const usEast1Stack = new cdk.Stack(undefined, 'USEast1Stack', {
5291- // env: { region: 'us-east-1' },
5292- // });
5293- // const euWest1Stack = new cdk.Stack(undefined, 'EUWest1Stack', {
5294- // env: { region: 'eu-west-1' },
5295- // });
5296-
5297- // // WHEN
5298- // const fnUSEast1 = new lambda.Function(usEast1Stack, 'MyFunction', {
5299- // runtime: lambda.Runtime.NODEJS_LATEST,
5300- // handler: 'index.handler',
5301- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5302- // });
5303-
5304- // const fnEUWest1 = new lambda.Function(euWest1Stack, 'MyFunction', {
5305- // runtime: lambda.Runtime.NODEJS_LATEST,
5306- // handler: 'index.handler',
5307- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5308- // });
5309-
5310- // // THEN
5311- // // Both should resolve to concrete runtime strings when regions are explicit
5312- // Template.fromStack(usEast1Stack).hasResourceProperties('AWS::Lambda::Function', {
5313- // Runtime: 'nodejs22.x',
5314- // });
5315-
5316- // Template.fromStack(euWest1Stack).hasResourceProperties('AWS::Lambda::Function', {
5317- // Runtime: 'nodejs22.x',
5318- // });
5319- // });
5320-
5321- // test('NODEJS_LATEST creates regional mapping in template', () => {
5322- // // GIVEN
5323- // const stack = new cdk.Stack();
5324-
5325- // // WHEN
5326- // new lambda.Function(stack, 'MyFunction', {
5327- // runtime: lambda.Runtime.NODEJS_LATEST,
5328- // handler: 'index.handler',
5329- // code: lambda.Code.fromInline('exports.handler = function() {}'),
5330- // });
5331-
5332- // // THEN
5333- // // Should create the LatestNodeRuntimeMap mapping
5334- // Template.fromStack(stack).hasMapping('LatestNodeRuntimeMap', {});
5335- // });
5336- // });
5337-
53385209function newTestLambda ( scope : constructs . Construct ) {
53395210 return new lambda . Function ( scope , 'MyLambda' , {
53405211 code : new lambda . InlineCode ( 'foo' ) ,
0 commit comments