@@ -6,6 +6,7 @@ describe("Runtime", () => {
66 expect ( isNodeRuntime ( Runtime . NODE10 ) ) . toBe ( true ) ;
77 expect ( isNodeRuntime ( Runtime . NODE12 ) ) . toBe ( true ) ;
88 expect ( isNodeRuntime ( Runtime . NODE14 ) ) . toBe ( true ) ;
9+ expect ( isNodeRuntime ( Runtime . NODE16 ) ) . toBe ( true ) ;
910 expect ( isNodeRuntime ( Runtime . PYTHON36 ) ) . toBe ( false ) ;
1011 expect ( isNodeRuntime ( Runtime . PYTHON37 ) ) . toBe ( false ) ;
1112 expect ( isNodeRuntime ( Runtime . PYTHON38 ) ) . toBe ( false ) ;
@@ -15,6 +16,7 @@ describe("Runtime", () => {
1516 expect ( isPythonRuntime ( Runtime . NODE10 ) ) . toBe ( false ) ;
1617 expect ( isPythonRuntime ( Runtime . NODE12 ) ) . toBe ( false ) ;
1718 expect ( isPythonRuntime ( Runtime . NODE14 ) ) . toBe ( false ) ;
19+ expect ( isPythonRuntime ( Runtime . NODE16 ) ) . toBe ( false ) ;
1820 expect ( isPythonRuntime ( Runtime . PYTHON36 ) ) . toBe ( true ) ;
1921 expect ( isPythonRuntime ( Runtime . PYTHON37 ) ) . toBe ( true ) ;
2022 expect ( isPythonRuntime ( Runtime . PYTHON38 ) ) . toBe ( true ) ;
@@ -24,24 +26,39 @@ describe("Runtime", () => {
2426 expect ( getRuntimeVersion ( Runtime . NODE10 ) ) . toBe ( "10" ) ;
2527 expect ( getRuntimeVersion ( Runtime . NODE12 ) ) . toBe ( "12" ) ;
2628 expect ( getRuntimeVersion ( Runtime . NODE14 ) ) . toBe ( "14" ) ;
29+ expect ( getRuntimeVersion ( Runtime . NODE16 ) ) . toBe ( "16" ) ;
2730 expect ( getRuntimeVersion ( Runtime . PYTHON36 ) ) . toBe ( "3.6" ) ;
2831 expect ( getRuntimeVersion ( Runtime . PYTHON37 ) ) . toBe ( "3.7" ) ;
2932 expect ( getRuntimeVersion ( Runtime . PYTHON38 ) ) . toBe ( "3.8" ) ;
3033 } ) ;
3134
35+ it ( "throw exception on get runtime version" , ( ) => {
36+ Runtime [ "invalid" ] = "invalid"
37+ expect ( ( ) => { getRuntimeVersion ( Runtime [ "invalid" ] ) } ) . toThrowError ( "Runtime invalid not included in supportedRuntimes" )
38+ delete Runtime [ "invalid" ]
39+ } )
40+
3241 it ( "gets runtime language" , ( ) => {
3342 expect ( getRuntimeLanguage ( Runtime . NODE10 ) ) . toBe ( "nodejs" ) ;
3443 expect ( getRuntimeLanguage ( Runtime . NODE12 ) ) . toBe ( "nodejs" ) ;
3544 expect ( getRuntimeLanguage ( Runtime . NODE14 ) ) . toBe ( "nodejs" ) ;
45+ expect ( getRuntimeLanguage ( Runtime . NODE16 ) ) . toBe ( "nodejs" ) ;
3646 expect ( getRuntimeLanguage ( Runtime . PYTHON36 ) ) . toBe ( "python" ) ;
3747 expect ( getRuntimeLanguage ( Runtime . PYTHON37 ) ) . toBe ( "python" ) ;
3848 expect ( getRuntimeLanguage ( Runtime . PYTHON38 ) ) . toBe ( "python" ) ;
3949 } ) ;
4050
51+ it ( "throw exception on get runtime language" , ( ) => {
52+ Runtime [ "invalid" ] = "invalid"
53+ expect ( ( ) => { getRuntimeLanguage ( Runtime [ "invalid" ] ) } ) . toThrowError ( "Runtime invalid not included in supportedRuntimes" )
54+ delete Runtime [ "invalid" ]
55+ } )
56+
4157 it ( "gets function worker runtime" , ( ) => {
4258 expect ( getFunctionWorkerRuntime ( Runtime . NODE10 ) ) . toBe ( "node" ) ;
4359 expect ( getFunctionWorkerRuntime ( Runtime . NODE12 ) ) . toBe ( "node" ) ;
4460 expect ( getFunctionWorkerRuntime ( Runtime . NODE14 ) ) . toBe ( "node" ) ;
61+ expect ( getFunctionWorkerRuntime ( Runtime . NODE16 ) ) . toBe ( "node" ) ;
4562 expect ( getFunctionWorkerRuntime ( Runtime . PYTHON36 ) ) . toBe ( "python" ) ;
4663 expect ( getFunctionWorkerRuntime ( Runtime . PYTHON37 ) ) . toBe ( "python" ) ;
4764 expect ( getFunctionWorkerRuntime ( Runtime . PYTHON38 ) ) . toBe ( "python" ) ;
0 commit comments