Tests concerning POSTing new notes failed with an enexpected 500 "Internal Server Error" after adding the update-user functionality to controllers/notes.js router since userId is now required for Mongoose to return the corresponding user object. I added a warning that this the exact reason for test failures so that other students don't spend too much time debugging the code.
P.S. For my tests to pass I also rewrote the beforeEach method since, if the userbase is cleared completely everytime, there will never be a stable userId that can be securely passed inside newNote objects to test the POST functionality.
Tests concerning POSTing new notes failed with an enexpected 500 "Internal Server Error" after adding the update-user functionality to controllers/notes.js router since userId is now required for Mongoose to return the corresponding user object. I added a warning that this the exact reason for test failures so that other students don't spend too much time debugging the code.
P.S. For my tests to pass I also rewrote the beforeEach method since, if the userbase is cleared completely everytime, there will never be a stable userId that can be securely passed inside newNote objects to test the POST functionality.