The simplest way to test a TypeScript library is by running all tests in Node.js, since it may work without a web server and a browser. Another advantage of running tests in Node.js is that library packages installed with npm, such as jQuery, may work as they are, while browser-based testing would require the use of a bundler since browsers do not support the Node.js-based module resolution algorithm required by npm packages.
On the other hand, tests that succeed under Node.js might fail on some browsers due to compatibility problems, so when Node.js testing is chosen, some browser-based compatibility tests on all dangerous features that might not be supported by all browsers are required.
Browser-based testing will be applied to Angular projects as described in the Testing section of Chapter 13, Navigation and Services. This and the...