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.
Node 18, chai assertions, instanceof checks, sample tests and better initial code (author gone)
Node v12 should be used along with its appropiate assertion tools (Mocha + Chai).
Refer to this and this
No random tests
No sample tests
You could add sample tests
hi, just wondering if no error detected for the code should it pass or not? because it is not passing eventhough (obj1 === obj2) is true and obj2.test is = 1.
thanks
Sam
I guess all of the instances should point to the same location in memory, so probably this solution would make more sense.
This the Singleton pattern is from "JavaScript Patterns" by Stoyan Stefanov.
The instance variable for the Singleton should be private; no public properties except those inherited from
Object
.I also agree very strongly with spicydonuts that the returned instance should pass
var obj = new Singleton();Test.expect(obj instanceof Singleton)