@@ -39,8 +39,8 @@ export = {
39
39
handler : 'index.handler'
40
40
} ) ;
41
41
42
- test . deepEqual ( calculateFunctionHash ( fn1 ) , 'a1dd0e860a511e65bf720e3bd0f6b6a9' ) ;
43
- test . deepEqual ( calculateFunctionHash ( fn2 ) , 'a1dd0e860a511e65bf720e3bd0f6b6a9 ' ) ;
42
+ test . deepEqual ( calculateFunctionHash ( fn1 ) , calculateFunctionHash ( fn2 ) ) ;
43
+ test . deepEqual ( calculateFunctionHash ( fn1 ) , 'aea5463dba236007afe91d2832b3c836 ' ) ;
44
44
test . done ( ) ;
45
45
} ,
46
46
} ,
@@ -53,8 +53,8 @@ export = {
53
53
handler : 'index.handler'
54
54
} ) ;
55
55
56
- test . notDeepEqual ( calculateFunctionHash ( fn1 ) , 'a1dd0e860a511e65bf720e3bd0f6b6a9 ' ) ;
57
- test . deepEqual ( calculateFunctionHash ( fn1 ) , '1ad32fcab0aa68bf36825df8e6f0a7a2 ' ) ;
56
+ test . notDeepEqual ( calculateFunctionHash ( fn1 ) , 'aea5463dba236007afe91d2832b3c836 ' ) ;
57
+ test . deepEqual ( calculateFunctionHash ( fn1 ) , '979b4a14c6f174c745cdbcd1036cf844 ' ) ;
58
58
test . done ( ) ;
59
59
} ,
60
60
@@ -79,8 +79,8 @@ export = {
79
79
}
80
80
} ) ;
81
81
82
- test . deepEqual ( calculateFunctionHash ( fn1 ) , 'ea4daca738e83756eec5a3a3c806d54d ' ) ;
83
- test . deepEqual ( calculateFunctionHash ( fn2 ) , '2cb1ed852c739c60254b3bbfb258e513 ' ) ;
82
+ test . deepEqual ( calculateFunctionHash ( fn1 ) , 'd1bc824ac5022b7d62d8b12dbae6580c ' ) ;
83
+ test . deepEqual ( calculateFunctionHash ( fn2 ) , '3b683d05465012b0aa9c4ff53b32f014 ' ) ;
84
84
test . done ( ) ;
85
85
} ,
86
86
@@ -105,8 +105,28 @@ export = {
105
105
}
106
106
} ) ;
107
107
108
- test . deepEqual ( calculateFunctionHash ( fn1 ) , 'ea4daca738e83756eec5a3a3c806d54d' ) ;
109
- test . deepEqual ( calculateFunctionHash ( fn2 ) , '4bdbec98b3c838410b5637fb71101514' ) ;
108
+ test . deepEqual ( calculateFunctionHash ( fn1 ) , 'd1bc824ac5022b7d62d8b12dbae6580c' ) ;
109
+ test . deepEqual ( calculateFunctionHash ( fn2 ) , '0f168f0772463e8e547bb3800937e54d' ) ;
110
+ test . done ( ) ;
111
+ } ,
112
+
113
+ 'inline code change impacts the hash' ( test : Test ) {
114
+ const stack1 = new Stack ( ) ;
115
+ const fn1 = new lambda . Function ( stack1 , 'MyFunction' , {
116
+ runtime : lambda . Runtime . NODEJS_12_X ,
117
+ code : lambda . Code . fromInline ( 'foo' ) ,
118
+ handler : 'index.handler' ,
119
+ } ) ;
120
+
121
+ const stack2 = new Stack ( ) ;
122
+ const fn2 = new lambda . Function ( stack2 , 'MyFunction' , {
123
+ runtime : lambda . Runtime . NODEJS_10_X ,
124
+ code : lambda . Code . fromInline ( 'foo bar' ) ,
125
+ handler : 'index.handler' ,
126
+ } ) ;
127
+
128
+ test . deepEqual ( calculateFunctionHash ( fn1 ) , 'ebf2e871fc6a3062e8bdcc5ebe16db3f' ) ;
129
+ test . deepEqual ( calculateFunctionHash ( fn2 ) , 'ffedf6424a18a594a513129dc97bf53c' ) ;
110
130
test . done ( ) ;
111
131
}
112
132
} ;
0 commit comments