File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const crypto = require('crypto');
1919const supertest = require ( 'supertest' ) ;
2020const functionsFramework = require ( '@google-cloud/functions-framework/testing' ) ;
2121
22- const { SLACK_SECRET } = process . env ;
22+ process . env . SLACK_SECRET = 'testsecret' ;
2323const SLACK_TIMESTAMP = Date . now ( ) ;
2424
2525require ( '../index' ) ;
@@ -30,7 +30,7 @@ const generateSignature = query => {
3030 const buf = Buffer . from ( body ) ;
3131 const plaintext = `v0:${ SLACK_TIMESTAMP } :${ buf } ` ;
3232
33- const hmac = crypto . createHmac ( 'sha256' , SLACK_SECRET ) ;
33+ const hmac = crypto . createHmac ( 'sha256' , process . env . SLACK_SECRET ) ;
3434 hmac . update ( plaintext ) ;
3535 const ciphertext = hmac . digest ( 'hex' ) ;
3636
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ const getSample = () => {
4848 googleapis : googleapis ,
4949 kgsearch : kgsearch ,
5050 config : config ,
51- eventsApi : eventsApi ,
5251 } ,
5352 } ;
5453} ;
You can’t perform that action at this time.
0 commit comments