@@ -6,6 +6,7 @@ describe("Runtime", () => {
6
6
expect ( isNodeRuntime ( Runtime . NODE10 ) ) . toBe ( true ) ;
7
7
expect ( isNodeRuntime ( Runtime . NODE12 ) ) . toBe ( true ) ;
8
8
expect ( isNodeRuntime ( Runtime . NODE14 ) ) . toBe ( true ) ;
9
+ expect ( isNodeRuntime ( Runtime . NODE16 ) ) . toBe ( true ) ;
9
10
expect ( isNodeRuntime ( Runtime . PYTHON36 ) ) . toBe ( false ) ;
10
11
expect ( isNodeRuntime ( Runtime . PYTHON37 ) ) . toBe ( false ) ;
11
12
expect ( isNodeRuntime ( Runtime . PYTHON38 ) ) . toBe ( false ) ;
@@ -15,6 +16,7 @@ describe("Runtime", () => {
15
16
expect ( isPythonRuntime ( Runtime . NODE10 ) ) . toBe ( false ) ;
16
17
expect ( isPythonRuntime ( Runtime . NODE12 ) ) . toBe ( false ) ;
17
18
expect ( isPythonRuntime ( Runtime . NODE14 ) ) . toBe ( false ) ;
19
+ expect ( isPythonRuntime ( Runtime . NODE16 ) ) . toBe ( false ) ;
18
20
expect ( isPythonRuntime ( Runtime . PYTHON36 ) ) . toBe ( true ) ;
19
21
expect ( isPythonRuntime ( Runtime . PYTHON37 ) ) . toBe ( true ) ;
20
22
expect ( isPythonRuntime ( Runtime . PYTHON38 ) ) . toBe ( true ) ;
@@ -24,24 +26,39 @@ describe("Runtime", () => {
24
26
expect ( getRuntimeVersion ( Runtime . NODE10 ) ) . toBe ( "10" ) ;
25
27
expect ( getRuntimeVersion ( Runtime . NODE12 ) ) . toBe ( "12" ) ;
26
28
expect ( getRuntimeVersion ( Runtime . NODE14 ) ) . toBe ( "14" ) ;
29
+ expect ( getRuntimeVersion ( Runtime . NODE16 ) ) . toBe ( "16" ) ;
27
30
expect ( getRuntimeVersion ( Runtime . PYTHON36 ) ) . toBe ( "3.6" ) ;
28
31
expect ( getRuntimeVersion ( Runtime . PYTHON37 ) ) . toBe ( "3.7" ) ;
29
32
expect ( getRuntimeVersion ( Runtime . PYTHON38 ) ) . toBe ( "3.8" ) ;
30
33
} ) ;
31
34
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
+
32
41
it ( "gets runtime language" , ( ) => {
33
42
expect ( getRuntimeLanguage ( Runtime . NODE10 ) ) . toBe ( "nodejs" ) ;
34
43
expect ( getRuntimeLanguage ( Runtime . NODE12 ) ) . toBe ( "nodejs" ) ;
35
44
expect ( getRuntimeLanguage ( Runtime . NODE14 ) ) . toBe ( "nodejs" ) ;
45
+ expect ( getRuntimeLanguage ( Runtime . NODE16 ) ) . toBe ( "nodejs" ) ;
36
46
expect ( getRuntimeLanguage ( Runtime . PYTHON36 ) ) . toBe ( "python" ) ;
37
47
expect ( getRuntimeLanguage ( Runtime . PYTHON37 ) ) . toBe ( "python" ) ;
38
48
expect ( getRuntimeLanguage ( Runtime . PYTHON38 ) ) . toBe ( "python" ) ;
39
49
} ) ;
40
50
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
+
41
57
it ( "gets function worker runtime" , ( ) => {
42
58
expect ( getFunctionWorkerRuntime ( Runtime . NODE10 ) ) . toBe ( "node" ) ;
43
59
expect ( getFunctionWorkerRuntime ( Runtime . NODE12 ) ) . toBe ( "node" ) ;
44
60
expect ( getFunctionWorkerRuntime ( Runtime . NODE14 ) ) . toBe ( "node" ) ;
61
+ expect ( getFunctionWorkerRuntime ( Runtime . NODE16 ) ) . toBe ( "node" ) ;
45
62
expect ( getFunctionWorkerRuntime ( Runtime . PYTHON36 ) ) . toBe ( "python" ) ;
46
63
expect ( getFunctionWorkerRuntime ( Runtime . PYTHON37 ) ) . toBe ( "python" ) ;
47
64
expect ( getFunctionWorkerRuntime ( Runtime . PYTHON38 ) ) . toBe ( "python" ) ;
0 commit comments