Testing Angular
  • Overview
  • Overview
  • 1. Create a new Angular CLI application
  • 2. Run default tests
  • 3. Review the Angular CLI directory and testing tools set up
  • 4. Jasmine tests
  • 5. Add simple test
  • 6. Add simple failing test
  • 7. Add another test to check a property
  • 8. Test the Component logic using a mocked up Service
  • 9. Test the Component logic using SpyOn
  • 10. TestBed and Fixtures
Powered by GitBook
On this page

1. Create a new Angular CLI application

PreviousOverviewNext2. Run default tests

Last updated 6 years ago

  • In the folder you would like to create this project run the following command

ng new testing
  • Change directory into the new project and open the CLI in Visual Studio Code

cd testing && code .
  • Run the application

ng serve
  • Open the application in your web browser at

http://localhost:4200