express-interceptor icon indicating copy to clipboard operation
express-interceptor copied to clipboard

Testing the isInterceptable, intercept methods

Open sureshseban opened this issue 2 years ago • 0 comments

Hi Team/@EricLin2004/@pierrebeugnot, Can any one provide me how can I test the interceptor methods using jest I am using the library as below

import interceptor from 'express-interceptor'; const myMiddleWare = interceptor((req, res, next) => ({ isInterceptable() { // do something.. return true; }, intercept(body, send) { // do something return html }, }));

export { myMiddleWare };

sureshseban avatar Jun 20 '22 05:06 sureshseban