File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ const getSample = () => {
5555const getMocks = ( ) => {
5656 const req = {
5757 headers : {
58- 'x-slack-signature' : 'v0=fakesignature' ,
58+ 'x-slack-signature' : 'v0=' + 'a' . repeat ( 64 ) ,
5959 'x-slack-request-timestamp' : `${ Math . floor ( Date . now ( ) / 1000 ) } ` ,
6060 } ,
6161 query : { } ,
@@ -141,7 +141,11 @@ describe('functions_slack_request functions_slack_search functions_verify_webhoo
141141 try {
142142 await kgSearch ( mocks . req , mocks . res ) ;
143143 } catch ( err ) {
144- assert . deepStrictEqual ( err , error ) ;
144+ assert . deepStrictEqual ( err . code , 401 ) ;
145+ assert . deepStrictEqual (
146+ err . message ,
147+ 'Invalid Slack signature (length mismatch)'
148+ ) ;
145149 assert . strictEqual ( mocks . res . status . callCount , 1 ) ;
146150 assert . deepStrictEqual ( mocks . res . status . firstCall . args , [ 500 ] ) ;
147151 assert . strictEqual ( mocks . res . send . callCount , 1 ) ;
You can’t perform that action at this time.
0 commit comments