Hello everyone,
I spent the whole weekend trying to figure out why I can’t pass the 3rd test. Every other test passes, but this one, for some reason, won’t and I can’t find out why.
I even read the test code here
I’ve logged every added exercise, and here you can see what my app is responding with.
I creates 4 exercises, this is the one created for the 1st test:
{
username: 'fcc_test_15940721610',
description: 'test',
duration: '60',
_id: '5f039c61f5591409291d66e3',
date: 'Mon Jan 01 1990'
}
I cant see why this isn’t working and ran out of ideas.
Edit:
Glitch Link
Hello and welcome to the FCC community~!
May we have a link to your Glitch project? Seeing the code would help us debug it.
Of course,
Glitch Link
As you can already deduce from some of the console.log statements, I’ve gone almost crazy trying to find the error.
Okay, so the only thing I see that might be throwing the error is you’re using moment to set the format for the date.
If I recall correctly, I was only able to get this test to pass with .toDateString()
.
I had tried that before, and tried it again just now, it does not work.
Side question: Why do i get an error with the Spread Operator within Glitch apps and the sample project doesnt.
That could be caused by a syntax error, or by a difference between your code elsewhere in the project.
I am not sure what else might be causing the bug, though I remember reading something about Glitch temporarily disallowing outside services to ping projects. Of course, now that I need that article I can’t find it.
My database registers every Post request, which means Glitch is allowing fcc to use my app. Also, the other tests pass.
I managed to solve this on my own, turns out Duration was being returned as a string.
If someone happens to read this, remember Duration must be a Number, and as such, cant be inside single or double quotes in the returned json.