Test for submitting the project for the Timestamp Microservice fails.
A request to /api/:date? with a valid date should return a JSON object with a unix key that is a Unix timestamp of the input date in milliseconds - Fails
A request to /api/1451001600000 should return { unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" } - Fails
Your project can handle dates that can be successfully parsed by new Date(date_string) - Fails
An empty date parameter should return the current time in a JSON object with a unix key - Fails
and the others pass.
Locally, it passes when I pass the date as 12-02-2021 , 12 02 2021, 1451001600000 or even Fri, 25 Dec 2015 00:00:00 GMT passes.
Can someone assist me with some resources to tackle this problem?
if your probles is only with the test “Your project can handle dates that can be successfully parsed by new Date(date_string)”, triying the test with the app deployed in production, i use vercel. That was the only test that fails, but in production it worked, i dont know really why
{"unix":1451001600000, "utc":"Fri, 25 Dec 2015 00:00:00 GMT"}
You have the fields reversed.
You can link a git repo to a repl.it project and if you do, you’re more likely to get faster and better help since people can fork and test your repl.it project in a browser window with little effort.
Hey!
As per my understanding of your project, in the GET API where date_string is passed as params, you first need to check if the input is in unix timestamp(eg: 1451001600000) or a normal date format(12-02-2021) and then accordingly convert them into respective unix and UTC timestamps.
Same goes for this, you need to put such conditions that all test cases of passing dates gets covered.