File tree Expand file tree Collapse file tree 5 files changed +93
-0
lines changed Expand file tree Collapse file tree 5 files changed +93
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export const supportedRuntimesArchitecture = {
1515 "nodejs16.x" : [ ARM64 , X86_64 ] ,
1616 "nodejs18.x" : [ ARM64 , X86_64 ] ,
1717 "nodejs20.x" : [ ARM64 , X86_64 ] ,
18+ "nodejs22.x" : [ ARM64 , X86_64 ] ,
1819 "python3.7" : [ X86_64 ] ,
1920 "python3.8" : [ ARM64 , X86_64 ] ,
2021 "python3.9" : [ ARM64 , X86_64 ] ,
@@ -47,6 +48,7 @@ export const supportedNodejs = new Set([
4748 "nodejs16.x" ,
4849 "nodejs18.x" ,
4950 "nodejs20.x" ,
51+ "nodejs22.x" ,
5052] )
5153
5254// PROVIDED
Original file line number Diff line number Diff line change @@ -44,3 +44,11 @@ functions:
4444 path : hello3
4545 handler : handler.hello
4646 runtime : python3.8
47+
48+ hello4 :
49+ events :
50+ - http :
51+ method : get
52+ path : hello4
53+ handler : handler.hello
54+ runtime : nodejs22.x
Original file line number Diff line number Diff line change 1+ import assert from "node:assert"
2+ import { env } from "node:process"
3+ import { join } from "desm"
4+ import { setup , teardown } from "../../../../_testHelpers/index.js"
5+ import { BASE_URL } from "../../../../config.js"
6+
7+ describe ( "Node.js 22.x with Docker tests" , function desc ( ) {
8+ beforeEach ( ( ) =>
9+ setup ( {
10+ servicePath : join ( import . meta. url ) ,
11+ } ) ,
12+ )
13+
14+ afterEach ( ( ) => teardown ( ) )
15+ ; [
16+ {
17+ description : "should work with nodejs22.x in docker container" ,
18+ expected : {
19+ message : "Hello Node.js 22.x!" ,
20+ } ,
21+ path : "/dev/hello" ,
22+ } ,
23+ ] . forEach ( ( { description, expected, path } ) => {
24+ it ( description , async function it ( ) {
25+ // "Could not find 'Docker', skipping tests."
26+ if ( ! env . DOCKER_DETECTED ) {
27+ this . skip ( )
28+ }
29+
30+ const url = new URL ( path , BASE_URL )
31+ const response = await fetch ( url )
32+ const json = await response . json ( )
33+
34+ assert . equal ( json . message , expected . message )
35+ } )
36+ } )
37+ } )
Original file line number Diff line number Diff line change 1+ "use strict"
2+
3+ // eslint-disable-next-line unicorn/prefer-node-protocol
4+ const { versions } = require ( "process" )
5+
6+ const { stringify } = JSON
7+
8+ module . exports . hello = async ( ) => {
9+ return {
10+ body : stringify ( {
11+ message : "Hello Node.js 22.x!" ,
12+ version : versions . node ,
13+ } ) ,
14+ statusCode : 200 ,
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ service : docker-nodejs22-x-test
2+
3+ configValidationMode : error
4+ deprecationNotificationMode : error
5+
6+ plugins :
7+ - ../../../../../src/index.js
8+
9+ provider :
10+ architecture : x86_64
11+ deploymentMethod : direct
12+ memorySize : 1024
13+ name : aws
14+ region : us-east-1
15+ runtime : nodejs22.x
16+ stage : dev
17+ versionFunctions : false
18+
19+ custom :
20+ serverless-offline :
21+ noTimeout : true
22+ useDocker : true
23+
24+ functions :
25+ hello :
26+ events :
27+ - http :
28+ method : get
29+ path : hello
30+ handler : handler.hello
You can’t perform that action at this time.
0 commit comments