Tests in TypeScript or JavaScript often run setup code inside hooks like “beforeEach”: Developers must take care to get the setup correct, especially in large or nested test suites. Some test runners now provide fixtures-per-test. We can re-write our test suite as the following: This test setup addresses our original pain points, and adds a […]
You can interact with the source code for this article using the TypeScript playground. Throughout my experience using TypeScript, I have constantly been finding new features in the type system that I had no idea existed. At some point, I discovered that the type system was turing complete! (If we ignore the infinite memory requirement) Many […]