File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,13 @@ abstract class PersistenceLayer implements PersistenceLayerInterface {
82
82
* @param data - the data payload that will be hashed to create the hash portion of the idempotency key
83
83
* @param result - the result of the successfully completed function
84
84
*/
85
- public async saveSuccess ( data : unknown , result : unknown ) : Promise < void > {
85
+ public async saveSuccess ( data : unknown , result : Record < string , unknown > ) : Promise < void > {
86
86
const idempotencyRecord : IdempotencyRecord =
87
87
new IdempotencyRecord ( this . getHashedIdempotencyKey ( data ) ,
88
88
IdempotencyRecordStatus . COMPLETED ,
89
89
this . getExpiryTimestamp ( ) ,
90
90
undefined ,
91
- JSON . stringify ( result ) ,
91
+ result ,
92
92
undefined
93
93
) ;
94
94
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ describe('Class: Persistence Layer', ()=> {
141
141
142
142
test ( 'When called it updates the idempotency record to COMPLETED' , async ( ) => {
143
143
const data = 'someData' ;
144
- const result = 'result' ;
144
+ const result = { } ;
145
145
const persistenceLayer : PersistenceLayer = new PersistenceLayerTestClass ( ) ;
146
146
147
147
await persistenceLayer . saveSuccess ( data , result ) ;
@@ -153,7 +153,7 @@ describe('Class: Persistence Layer', ()=> {
153
153
154
154
test ( 'When called it generates the idempotency key from the function name and a digest of the md5 hash of the data' , async ( ) => {
155
155
const data = 'someData' ;
156
- const result = 'result' ;
156
+ const result = { } ;
157
157
const lambdaFunctionName = 'LambdaName' ;
158
158
jest . spyOn ( EnvironmentVariablesService . prototype , 'getLambdaFunctionName' ) . mockReturnValue ( lambdaFunctionName ) ;
159
159
@@ -180,7 +180,7 @@ describe('Class: Persistence Layer', ()=> {
180
180
test ( 'When called it sets the expiry timestamp to one hour in the future' , async ( ) => {
181
181
const persistenceLayer : PersistenceLayer = new PersistenceLayerTestClass ( ) ;
182
182
const data = 'someData' ;
183
- const result = 'result' ;
183
+ const result = { } ;
184
184
const currentMillisTime = 3000 ;
185
185
const currentSeconds = currentMillisTime / 1000 ;
186
186
const oneHourSeconds = 60 * 60 ;
You can’t perform that action at this time.
0 commit comments