Timestamp Microservice not passing

Timestamp Microservice not passing
0

I completed the timestamp microservice and it is meeting all of the user stories when I test it. However, it fails to pass any of the submission tests. I can’t figure out why. Anyone have ideas?

https://tourmaline-act.glitch.me/

Hello!

The user story 5 is not fulfilled.

Required

{"unix": null, "utc" : "Invalid Date" }

Your output

{"error":"invalid date"}

Hope it helps :smile:,

Regards!

Thanks, that needed to be addressed. However, it still fails every test on FCC even though it passes when I try it manually.

Can you share your editor view (not the live page)? I suspect it has something to do with the script FCC uses to validate the routes or CORS.

{"error":"invalid date"}

I feel this is what the return should be. Returning invalid values on failure is terribly bad practice. Still, to meet the FCC tests, you have to use its broken API convention. Good practice for the real world, I suppose, but FCC shouldn’t be providing the bad examples.

1 Like

Added the editor view in the OP. Thanks for looking into this :grin:

After checking my own solution, I realized they changed the challenge and it didn’t work now (failed the error response). After reading the solution, the expected result is just what @chuckadams mentions but it’s not mentioned in our instructions (I don’t know if they updated them now).

I just tested your project and it’s working except for the error result, which must have the format previously mentioned:

// Invalid date:
{
  "error": "Invalid Date"
}

// Valid or empty date:
{
  "unix": 1451001600000,
  "utc": "Fri, 25 Dec 2015 00:00:00 GMT"
}