Ad
  • Custom User Avatar

    JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai).
    Refer to this and this

  • Custom User Avatar

    How does the anti-cheat work?

  • Custom User Avatar

    Your tests never check to see if the private variables are actually private.

  • Custom User Avatar

    A solution with a public variable name can pass the tests, which is not what was expected from the kata description.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    There is no notion of private variables in this kata.

  • Custom User Avatar

    You need to check the object to ensure that no public variable is the value of a public variable. In fact, might be better to disqualify any public variables that aren't methods.

  • Custom User Avatar

    I think you need to do some checks to make sure the value isn't being stored on the instance. You could do something like: var method = instance.getName; method(); // should still return value, even though the context isn't set to the instance.

    Also, you never really explain what is expected. You need to say that we are writing a Person class that needs those methods defined.

    You could also add more tests, and randomly-generated ones quite easily, to prevent cheating by wrote.