I need some help, it seems that the FCC tesiting engine is disfunctioning

Tell us what’s happening:
Can somebody help me with this? My code seems to work fine, also if I console.log the thread object, it has all the fields required by the test, but still it doesn’t pass test #5.

Also, it was weird from the start that most of the tests passed (like the 10 functional test checker), without anything written in the 2_functional-tests.js file or without writing the corresponding code for the respective tests.

I don’t know what am I doing wrong, for me it seems the test engine has some problems.

Your project link(s)

githubLink: https://github.com/ddyfedd/fcc-is-anonymous-message.git
solution: Glitch :・゚✧

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36.

Challenge: Anonymous Message Board

Link to the challenge:

Hello there,

When I run your app through the tests, I see it failing one test:

You can send a POST request to /api/threads/{board} with form data including text and delete_password . The saved database record will have at least the fields _id , text , created_on (date & time), bumped_on (date & time, starts same as created_on ), reported (boolean), delete_password , & replies (array).

And this is in the console:

Error: expected undefined to be a boolean

This is what the tests are navigating to:

And this is your app’s response (just the one object):

{
  "_id":"60882a033eec4b00c3443632",
  "text":"fcc_test_Tue Apr 27 2021 16:13:06 GMT+0100 (British Summer Time)",
  "replies":[],
  "board":"fcc_test",
  "created_on":"2021-04-27T15:13:07.000Z",
  "bumped_on":"2021-04-27T15:13:07.000Z",
  "__v":0,
  "replycount":0
}

I do not see a reported variable.

Looking at your code, this seems why:

Thread.find({board: req.params.board})
      .sort({bumped_on: 'desc'})
      .limit(10)
      .select('-delete_password -reported')

I see this goes against one of the user stories, and this is because it has not been written yet:

I suggest you ignore the latter user story, and not remove the reported or delete_password fields.

Hope this helps

Hi!

Thank you for helping out, this solved the issue, I had to modify one of the functional tests so all 10 pass.

Wish you all the best!

currently working on the project. Does the test in question expect the POST to return a json representing the document stored in the DB?

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