diff --git a/src/armTemplates/resources/functionApp.test.ts b/src/armTemplates/resources/functionApp.test.ts index 9945439b..c280e1b5 100644 --- a/src/armTemplates/resources/functionApp.test.ts +++ b/src/armTemplates/resources/functionApp.test.ts @@ -231,6 +231,23 @@ describe("Function App Resource", () => { expect(functionAppNodeVersion.value).toEqual("~16"); }); + it("gets correct parameters - node 18", () => { + const config = getConfig(FunctionAppOS.LINUX, Runtime.NODE18); + + const resource = new FunctionAppResource(); + + const params = resource.getParameters(config); + const { + linuxFxVersion, + functionAppNodeVersion, + } = params; + + assertLinuxParams(params); + + expect(linuxFxVersion.value).toEqual("NODE|18"); + expect(functionAppNodeVersion.value).toEqual("~18"); + }); + it("gets correct parameters - python 3.6", () => { const config = getConfig(FunctionAppOS.LINUX, Runtime.PYTHON36); diff --git a/src/config/runtime.test.ts b/src/config/runtime.test.ts index a1e0e530..b4835ea6 100644 --- a/src/config/runtime.test.ts +++ b/src/config/runtime.test.ts @@ -7,6 +7,7 @@ describe("Runtime", () => { expect(isNodeRuntime(Runtime.NODE12)).toBe(true); expect(isNodeRuntime(Runtime.NODE14)).toBe(true); expect(isNodeRuntime(Runtime.NODE16)).toBe(true); + expect(isNodeRuntime(Runtime.NODE18)).toBe(true); expect(isNodeRuntime(Runtime.PYTHON36)).toBe(false); expect(isNodeRuntime(Runtime.PYTHON37)).toBe(false); expect(isNodeRuntime(Runtime.PYTHON38)).toBe(false); @@ -17,6 +18,7 @@ describe("Runtime", () => { expect(isPythonRuntime(Runtime.NODE12)).toBe(false); expect(isPythonRuntime(Runtime.NODE14)).toBe(false); expect(isPythonRuntime(Runtime.NODE16)).toBe(false); + expect(isPythonRuntime(Runtime.NODE18)).toBe(false); expect(isPythonRuntime(Runtime.PYTHON36)).toBe(true); expect(isPythonRuntime(Runtime.PYTHON37)).toBe(true); expect(isPythonRuntime(Runtime.PYTHON38)).toBe(true); @@ -27,6 +29,7 @@ describe("Runtime", () => { expect(getRuntimeVersion(Runtime.NODE12)).toBe("12"); expect(getRuntimeVersion(Runtime.NODE14)).toBe("14"); expect(getRuntimeVersion(Runtime.NODE16)).toBe("16"); + expect(getRuntimeVersion(Runtime.NODE18)).toBe("18"); expect(getRuntimeVersion(Runtime.PYTHON36)).toBe("3.6"); expect(getRuntimeVersion(Runtime.PYTHON37)).toBe("3.7"); expect(getRuntimeVersion(Runtime.PYTHON38)).toBe("3.8"); @@ -43,6 +46,7 @@ describe("Runtime", () => { expect(getRuntimeLanguage(Runtime.NODE12)).toBe("nodejs"); expect(getRuntimeLanguage(Runtime.NODE14)).toBe("nodejs"); expect(getRuntimeLanguage(Runtime.NODE16)).toBe("nodejs"); + expect(getRuntimeLanguage(Runtime.NODE18)).toBe("nodejs"); expect(getRuntimeLanguage(Runtime.PYTHON36)).toBe("python"); expect(getRuntimeLanguage(Runtime.PYTHON37)).toBe("python"); expect(getRuntimeLanguage(Runtime.PYTHON38)).toBe("python"); @@ -59,6 +63,7 @@ describe("Runtime", () => { expect(getFunctionWorkerRuntime(Runtime.NODE12)).toBe("node"); expect(getFunctionWorkerRuntime(Runtime.NODE14)).toBe("node"); expect(getFunctionWorkerRuntime(Runtime.NODE16)).toBe("node"); + expect(getFunctionWorkerRuntime(Runtime.NODE18)).toBe("node"); expect(getFunctionWorkerRuntime(Runtime.PYTHON36)).toBe("python"); expect(getFunctionWorkerRuntime(Runtime.PYTHON37)).toBe("python"); expect(getFunctionWorkerRuntime(Runtime.PYTHON38)).toBe("python"); diff --git a/src/config/runtime.ts b/src/config/runtime.ts index 7fc37fb9..a77b6840 100644 --- a/src/config/runtime.ts +++ b/src/config/runtime.ts @@ -4,6 +4,7 @@ export enum Runtime { NODE12 = "nodejs12", NODE14 = "nodejs14", NODE16 = "nodejs16", + NODE18 = "nodejs18", PYTHON36 = "python3.6", PYTHON37 = "python3.7", PYTHON38 = "python3.8", @@ -16,6 +17,7 @@ export const supportedRuntimes = [ Runtime.NODE12, Runtime.NODE14, Runtime.NODE16, + Runtime.NODE18, Runtime.PYTHON36, Runtime.PYTHON37, Runtime.PYTHON38, @@ -95,6 +97,7 @@ export const dockerImages = { nodejs12: "NODE|12", nodejs14: "NODE|14", nodejs16: "NODE|16", + nodejs18: "NODE|18", "python3.6": "PYTHON|3.6", "python3.7": "PYTHON|3.7", "python3.8": "PYTHON|3.8", diff --git a/src/services/configService.test.ts b/src/services/configService.test.ts index 4a61b388..803c8126 100644 --- a/src/services/configService.test.ts +++ b/src/services/configService.test.ts @@ -225,7 +225,7 @@ describe("Config Service", () => { sls.service.provider.runtime = "python2.7" as any; expect(() => new ConfigService(sls, {} as any)) .toThrowError("Runtime python2.7 is not supported. " + - "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,python3.6,python3.7,python3.8"); + "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,nodejs18,python3.6,python3.7,python3.8"); }); it("throws error when incomplete nodejs version in defined", () => { @@ -233,7 +233,7 @@ describe("Config Service", () => { sls.service.provider.runtime = "nodejs" as any; expect(() => new ConfigService(sls, {} as any)) .toThrowError("Runtime nodejs is not supported. " + - "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,python3.6,python3.7,python3.8"); + "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,nodejs18,python3.6,python3.7,python3.8"); }); it("throws error when unsupported nodejs version in defined", () => { @@ -241,7 +241,7 @@ describe("Config Service", () => { sls.service.provider.runtime = "nodejs5.x" as any; expect(() => new ConfigService(sls, {} as any)) .toThrowError("Runtime nodejs5.x is not supported. " + - "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,python3.6,python3.7,python3.8"); + "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,nodejs18,python3.6,python3.7,python3.8"); }); it("Does not throw an error when valid nodejs version is defined", () => { @@ -258,7 +258,7 @@ describe("Config Service", () => { sls.service.provider.runtime = undefined; expect(() => new ConfigService(sls, {} as any)) .toThrowError("Runtime undefined. " + - "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,python3.6,python3.7,python3.8"); + "Runtimes supported: nodejs10,nodejs12,nodejs14,nodejs16,nodejs18,python3.6,python3.7,python3.8"); }); it("does not throw an error with python3.6", () => {