User Management: invalid response to register

All tests are passed. What can I do to solve it? I am sure 100% my code is ok.

Determining test suites to run…Setup Mongo Connection
PASS test/user-management.test.js
User Management
✓ it can add a new user to the database (326ms)
✓ it returns an error when trying to register duplicate user (160ms)
✓ it allows a user to login (311ms)
✓ it allows a user to logout (311ms)

Test Suites: 1 passed, 1 total
Tests: 4 passed, 4 total
Snapshots: 0 total
Time: 4.032s
Ran all test suites matching /user-management/i.
Teardown Mongo Connection

What is the problem? You need to be a lot more descriptive about what your actual problem is when you post questions.

You possibly mean the following, which has already been addressed anyway:

Or at least one of the variants where you either have a stale version of the application code which can be updated, or your “data” is incomplete.

Those are pretty much the reasons outside of we really hope you did NOT alter the “tests” in any way just to make them pass. Since if you did that, then your code that needed implementing is still incorrect and would need correcting and re-testing with the un-altered tests.

Ok. I’ve tried to do it with the code from “See detailed answer” and after clean new cluster setup, and it’s also doesn’t work on the status page. Is that mean the “correct code” from this course also implemented “incorrect and would need correcting and re-testing with the un-altered tests”?

UPD Yes! I’ve found the reason why it did not work. It wasn’t about the code as I said but the wrong connection settings. I was so stupid and didn’t see that I forgot to set up the SECRET_KEY)))) My mistake.

So, maybe somebody will find it helpful.

Thanks David. I did the same thing! I actually commented it out cuz i dint know that it was necessary!