You can still use new mySingleton.constructor() for testing purposes if your singleton has persistent states. Yes, it's a tiny bit less elegant. No, it's not impossible to use a singleton in TDD.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can still use
new mySingleton.constructor()
for testing purposes if your singleton has persistent states. Yes, it's a tiny bit less elegant. No, it's not impossible to use a singleton in TDD.