@@ -18,6 +18,10 @@ describe("supported runtimes", () => {
1818 expect ( supported . isRuntime ( "nodejs20" ) ) . to . be . true ;
1919 } ) ;
2020
21+ it ( "identifies nodejs24 as a valid runtime" , ( ) => {
22+ expect ( supported . isRuntime ( "nodejs24" ) ) . to . be . true ;
23+ } ) ;
24+
2125 it ( "identifies invalid runtimes" , ( ) => {
2226 expect ( supported . isRuntime ( "prolog1" ) ) . to . be . false ;
2327 } ) ;
@@ -64,5 +68,22 @@ describe("supported runtimes", () => {
6468 "details on the lifecycle policy" ,
6569 ) ;
6670 } ) ;
71+
72+ it ( "does not warn for nodejs24 before deprecation date" , ( ) => {
73+ supported . guardVersionSupport ( "nodejs24" , new Date ( "2027-01-01" ) ) ;
74+ expect ( logLabeledWarning ) . to . not . have . been . called ;
75+ } ) ;
76+
77+ it ( "warns for nodejs24 leading up to deprecation" , ( ) => {
78+ supported . guardVersionSupport ( "nodejs24" , new Date ( "2028-04-01" ) ) ;
79+ expect ( logLabeledWarning ) . to . have . been . calledWith (
80+ "functions" ,
81+ "Runtime Node.js 24 will be deprecated on 2028-04-30 and will be " +
82+ "decommissioned on 2028-10-31, after which you will not be able to " +
83+ "deploy without upgrading. Consider upgrading now to avoid disruption. See " +
84+ "https://cloud.google.com/functions/docs/runtime-support for full " +
85+ "details on the lifecycle policy" ,
86+ ) ;
87+ } ) ;
6788 } ) ;
6889} ) ;
0 commit comments