What's the problem with my code

Tell us what’s happening:
Describe your issue in detail here.
I have started my backend projects. Am currently doing the timestamp microservice project and even though its working am not passing the tests.

Your project link(s)

solution: https://replit.com/@muthwaian/boilerplate-project-timestamp-8

Your browser information:

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

Challenge: Timestamp Microservice

Link to the challenge:

If it is not passing the tests, then it is not “working”, by definition. “Working” doesn’t mean it does what you think it should do, but doing what the specs say it should do.

Taking a look at the test cases, let’s look at this one:

A request to /api/1451001600000 should return { unix: 1451001600000, utc: "Fri, 25 Dec 2015 00:00:00 GMT" }

If I open the web dev tools and look at the network tab, and run the tests, I can see what is happening:

It is returning something different than what is required.

With that tool, see if you can figure out what is going on.

but surely you do understand what I meant by working. Thank you for your feedback.

I have seen its actually not returning what is required. am still trying to figure out what’s going on

Yes, of course I understood. But my point was to change your focus. The specs are what matter. That has a hard lesson to learn for me at work - it didn’t matter what I thought it should be, it mattered what the specs were, the user stories, whatever. That should be the focus.

Check back if you get stuck again.

Thank you so much. The specs really matter. Finally was able to solve it

1 Like