Exercise Tracker. Test #8 fails. Unknown reason

The test is:

The response returned from POST /api/users/:_id/exercises will be the user object with the exercise fields added.

The following code does not pass this test, despite the results look exactly the same as required:

var usersLookup = {};
var excerciseLookup = {};
var counterUser = 0;
var counterExercise = 0;

app.post("/api/users/:_id/exercises", (req, res) => {
  const user = usersLookup[req.params._id];
  if (user !== undefined) {
    const _id = req.params._id;
    const currCounter = counterExercise;
    const description = req.body.description;
    const duration = parseInt(req.body.duration);
    let date = (req.body.date === undefined || req.body.date.length === 0
                      ? new Date()
                      : new Date(req.body.date)).toDateString();

    excerciseLookup[currCounter] = {
      _id,
      description: description,
      duration: duration,
      date: date
    };
    ++counterExercise;

    const result = {
      username: user,
      description: description,
      duration: duration,
      _id,
      date: date,
    };

    console.log(result);

    res.json(result);
  } else {
    res.send();
  }
});

The example of result:

{
  username: 'fcc_test_16312001970',
  description: 'test',
  duration: 60,
  _id: '11',
  date: 'Mon Jan 01 1990'
}

Looks correct. But the test still fails.

Any solutions or advice, why it can fail?

P.S. All other tests pass.

Do you have a live example we can look at?

I couldn’t get it to pass as well when sending an array of data with res.json. I was able to get it to pass by putting the data into a schema instead of an array.

https://boilerplate-project-exercisetracker.eugenetolstikhi.repl.co - live example

https://replit.com/@EugeneTolstikhi/boilerplate-project-exercisetracker - that is a full code of this exercise

https://boilerplate-project-exercisetracker.eugenetolstikhi.repl.co - live example

https://replit.com/@EugeneTolstikhi/boilerplate-project-exercisetracker - that is a full code of this exercise