As I understand, there is no destructors in typescript unlike most languages. I have an object in my tests which initialize a connection to the database. What approach should I take in order to make sure the programmer called the method disconnect before the test ends?
Is there a way to make the object autonomous in the detection of connection leaks, or is the only option to remember to call in the afterAll
block. What do people usually do?