Not sure if this is a duplicate but couldn’t find anything.
I need to test a bunch of routes using mocha and supertest, however every route is locked down with the following:
const { requiresAuth, auth } = require(“express-openid-connect”);
const AUTH_CONFIG = {
authRequired: false,
auth0Logout: true,
baseURL:
secret:
clientID:
issuerBaseURL: ,
routes: {
callback: “/auth0/callback”,
postLogoutRedirect: “/login”,
},
};
app.use(auth(AUTH_CONFIG));
app.use(
‘/route’
requiresAuth(),
);
Is there a way I can stub a response for requiresAuth() so i can bypass for testing? If not, how can I get around this issue?
Thank You