From the course: Creating Angular Libraries
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Testing and debugging Angular libraries - Angular Tutorial
From the course: Creating Angular Libraries
Testing and debugging Angular libraries
- [Instructor] As of this recording, Angular still comes with the Jasmine Test Framework and Karma Test Runner for writing and running unit tests. You can use a different testing framework if you want to, just be sure to follow the official recommendations for whatever you use. You test your custom library the same way you would test a regular application, by running the ng test command in your terminal of choice. The only difference is that you must pass in the project name as the first argument. Angular will build your library, launch the Karma Test Runner, and run your test suite. When using GitHub Codespaces, you may see an error in the console like this one here that says something like, no binary for Chrome browser on your platform. Please set CHROME_BIN environment variable. This happens because of how Codespaces virtual machine forwards ports from inside the container to your browser. To fix the error, just close the Karma tab if you have one and reopen it. You know it worked…
Contents
-
-
-
-
(Locked)
Stateless components5m 12s
-
(Locked)
Pure pipes2m 31s
-
(Locked)
Tree-shakeable providers2m 55s
-
(Locked)
Internationalization1m 52s
-
(Locked)
Directive composition2m 31s
-
(Locked)
Gain more control with Angular refs3m 36s
-
(Locked)
Testing and debugging Angular libraries2m 12s
-
(Locked)
Coding challenge18s
-
(Locked)
Solution2m 5s
-
(Locked)
-
-
-