QA Projects - Personal Library test 2

Tell us what’s happening:

All my tests are passing in my Replit but when i submit its telling me that the 2nd test isnt right for some reason. This is the exact message im seeing:

// tests completed
// console output
[Error: {“error”:“missing required field title”}]

I can see the message when i hit the submit button without a title though so im very confused. Any help would be appreciated

Your project link(s)

solution: https://replit.com/@s0undw1tch/2-personal-library

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Quality Assurance Projects - Personal Library

the returned response should be the string missing required field title .

Didn’t test it but have you tried sending just the string as asked for and not an object?


As an aside, I would be a little careful about using 400 status codes with some of the challenges. I’m pretty sure some of the tests expect a 200 even when testing failing stuff. The test might do a fetch and expect an error response in the form of an error string or whatever. But it may still check its fetch call was successful by looking at the res.ok and failing the check because it gets back a 404.

500 codes should be fine.

1 Like

Thank you! I tried implementing your suggestion but i was still getting the error. After trying other things i realized the issue was that my post wasn’t async.

1 Like

You should use res.send and not res.json when sending text.

Anyway, the test is definitely expecting the return to be a string.

https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/06-quality-assurance/quality-assurance-projects/personal-library.md

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.