javascript icon indicating copy to clipboard operation
javascript copied to clipboard

FIxed typo in testing which wasn't letting updatePlayer test pass

Open IAmRC1 opened this issue 3 years ago • 1 comments

IAmRC1 avatar Oct 28 '22 19:10 IAmRC1

Dear IAmRC1

Thank you for contributing to the JavaScript track on Exercism! 💙 You will see some automated feedback below 🤖. It would be great if you can make sure your PR covers those points. This will save your reviewer some time and your change can be merged quicker.

  • ✍️ If your PR is not related to an existing issue (and is not self-explaining like a typo fix), please make sure the description explains why the change you made is necessary.

  • 🔤 If your PR fixes an easy to identify typo, if would be great if you could check for that typo in the whole repo. For example, if you found Unicdoe, use "replace all" in your editor (or command line magic) to fix it consistently.

Dear Reviewer/Maintainer

  • 📏 Make sure you set the appropriate x:size label for the PR. (This also works after merging, in case you forgot about it.)

  • 🔍 Don't be too nit-picky. If the PR is a clear improvement compared to the status quo, it should be approved as clear signal this is good to be merged even if the minor comments you might have are not addressed by the contributor. Further improvement ideas can be captured in issues (if important enough) and implemented via additional PRs.

  • 🤔 After reviewing the diff in the "Files changed" section, take a moment to think about whether there are changes missing from the diff. Does something need to be adjusted in other places so the code or content stays consistent?

Automated comment created by PR Commenter 🤖.

github-actions[bot] avatar Oct 28 '22 19:10 github-actions[bot]

There is no typo in this test. The test is correct. The proof is used in our CI to make sure all tests are correct.

SleeplessByte avatar Oct 29 '22 12:10 SleeplessByte

Screenshot 2022-10-30 at 12-56-14 Getting Started Exercism's Docs

Just compare actual and expected in the screenshot

IAmRC1 avatar Oct 30 '22 07:10 IAmRC1

Instead of insisting it must be the tests that are incorrect, please provide the diff in the proof that is currently incorrect according to you, that would require the test to be changed.

The tests pass with the current exemplar solution

The test is checking if two consecutive calls to updateScore yield the correct result.

Starting with:

const scoreBoard = {
  'Amil Pastorius': 99373,
  'Min-seo Shin': 0,
  'Jesse Johnson': 1337,
};

It first updates 'Min-seo Shin' by increasing their score by 1999. This yields an intermediate scoreboard of

const scoreBoard = {
  'Amil Pastorius': 99373,
  'Min-seo Shin': 1999,
  'Jesse Johnson': 1337,
};

It then updates 'Jesse Johnson' by increasing their score by 1337. Their current score is already 1337, so the result would be 1337 + 1337 = 2674. The final scoreboard therefore looks like:

const scoreBoard = {
 'Amil Pastorius': 99373,
 'Min-seo Shin': 1999,
 'Jesse Johnson': 2674,
};

If your implementation is failing the test and can be fixed by changing the updateScore value to 2674, the most likely mistake you made is replacing the score instead of increasing the score as both the task and instructions say.

SleeplessByte avatar Oct 30 '22 23:10 SleeplessByte