Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai).
Refer to this and this
How does the anti-cheat work?
Your tests never check to see if the private variables are actually private.
A solution with a public variable
name
can pass the tests, which is not what was expected from the kata description.This comment is hidden because it contains spoiler information about the solution
There is no notion of private variables in this kata.
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.
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.