Hi everyone.
I have found a possible bug in test script, but I am not sure. Is it maybe my code?
In task 4, the test take updateScore and run the next code:
updateScore(scoreBoard, 'Min-seo Shin', 1999);
const actual = updateScore(scoreBoard, 'Jesse Johnson', 1337);
However, the expected result is not consistent, because the input to “Jesse Johnson” player was “1337” and not “2674”:
const scoreBoard = {
'Amil Pastorius': 99373,
'Min-seo Shin': 0,
'Jesse Johnson': 1337,
};
const expected = {
'Amil Pastorius': 99373,
'Min-seo Shin': 1999,
'Jesse Johnson': 2674,
};
My code:
export function updateScore(scoreBoard, player, points) {
scoreBoard[player] = points;
return scoreBoard;
}
This bug keeping me stuck. I can’t pass the exercise.