From the course: Learning the Angular CLI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The ng test command

The ng test command - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

The ng test command

- [Victor] In order to run your unit test, you can simply run NG test. This will grab all of your spec files, transpile them in memory and run your unit tests in Chrome. Now I see Chrome automatically open up here and I can see each one of my specs. If you'll notice here, the process did not exit. The source and spec files are currently being watched. And so when you change your code, your specs will automatically run. Let me go ahead and change a file, heading over to the core folder and the pipes folder. And let me change a test here on line 22 to a different string. Give that a save, and you'll see that the test suite runs again. In this case, it will fail. Let me change that back to the correct value. Give it a save, and the test suite will run again and now my tests are passing.

Contents