0

I have an express app. I am using Jest to test. I need to add express.json() to my app just for testing, I don't want this in the backend code at all. I tried this suggestion: https://stackoverflow.com/a/64289458/1057630

However, I kept getting the error layer.match is not a function.

Any clever way to prepend app.use(express.json) to my app, keeping in mind the app already has all the routes and is exported when it gets to the testing file.

I have tried prepending using this suggested method: https://stackoverflow.com/a/64289458/1057630 I have also tried slightly similar variations with no success.

Nehemiah
  • 61
  • 3

0 Answers0