@@ -27,6 +27,7 @@ const config = new Configuration({});
2727import { ErrorMessage } from '../../../src/classes/error-message' ;
2828import { RequestHandler } from '../../../src/google-apis/auth-client' ;
2929import { RequestInformationContainer } from '../../../src/classes/request-information-container' ;
30+ import { Request } from '../../../src/request-extractors/manual' ;
3031
3132describe ( 'Manual handler' , ( ) => {
3233 // nock.disableNetConnect();
@@ -117,17 +118,21 @@ describe('Manual handler', () => {
117118 assert . strictEqual ( r . context . httpRequest . method , 'TACKEY' ) ;
118119 } ) ;
119120 it ( 'Should ignore arguments' , done => {
120- const r = report ( 'hockey' , ( ) => {
121- done ( ) ;
122- } , 'field' ) ;
121+ const r = report (
122+ 'hockey' , ( ( ) => {
123+ done ( ) ;
124+ } ) as unknown as string ,
125+ 'field' as unknown as manual . Callback ) ;
123126 assert (
124127 r . message . match ( 'hockey' ) && ! r . message . match ( 'field' ) ,
125128 'string after callback should be ignored' ) ;
126129 } ) ;
127130 it ( 'Should ignore arguments' , done => {
128- const r = report ( 'passkey' , ( ) => {
129- done ( ) ;
130- } , { method : 'HONK' } ) ;
131+ const r = report (
132+ 'passkey' , ( ( ) => {
133+ done ( ) ;
134+ } ) as unknown as string ,
135+ { method : 'HONK' } as unknown as manual . Callback ) ;
131136 assert . notEqual ( r . context . httpRequest . method , 'HONK' ) ;
132137 } ) ;
133138 it ( 'Should allow null arguments as placeholders' , done => {
@@ -137,21 +142,25 @@ describe('Manual handler', () => {
137142 assert ( r . message . match ( / p o k e y / ) , 'string error should propagate' ) ;
138143 } ) ;
139144 it ( 'Should allow explicit undefined' , done => {
140- const r = report ( 'Turkey' , undefined , undefined , ( ) => {
141- done ( ) ;
142- } ) ;
145+ const r = report (
146+ 'Turkey' , undefined as unknown as Request ,
147+ undefined as unknown as string , ( ) => {
148+ done ( ) ;
149+ } ) ;
143150 assert ( r . message . match ( / T u r k e y / ) , 'string error should propagate' ) ;
144151 } ) ;
145152 it ( 'Should allow request to be supplied as undefined' , done => {
146- const r = report ( 'turnkey' , undefined , 'solution' , ( ) => {
147- done ( ) ;
148- } ) ;
153+ const r =
154+ report ( 'turnkey' , undefined as unknown as Request , 'solution' , ( ) => {
155+ done ( ) ;
156+ } ) ;
149157 assert . strictEqual ( r . message , 'solution' , 'error should propagate' ) ;
150158 } ) ;
151159 it ( 'Should allow additional message' , done => {
152- const r = report ( 'Mickey' , { method : 'SNIFF' } , undefined , ( ) => {
153- done ( ) ;
154- } ) ;
160+ const r = report (
161+ 'Mickey' , { method : 'SNIFF' } , undefined as unknown as string , ( ) => {
162+ done ( ) ;
163+ } ) ;
155164 assert (
156165 r . message . match ( / M i c k e y / ) && ! r . message . match ( / S N I F F / ) ,
157166 'string error should propagate' ) ;
0 commit comments