When doing testing in Java, I could use the package-protected access level to ensure proper encapsulation without making methods public. However, when testing Typescript, I have encountered several situations where I wish I could do a similar thing, as the method I am looking at seems sufficiently complex and is currently set as private or protected.
What is the best practice for testing these types of functions? Should they just be made public for the purposes of testing, or is there an easier way?