> For the complete documentation index, see [llms.txt](https://duncanhunter.gitbook.io/testing-angular/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://duncanhunter.gitbook.io/testing-angular/run-default-tests.md).

# 2. Run default tests

### Run the default unit tests with Karma and Jasmine <a href="#title" id="title"></a>

* Run the default unit tests in src/app/app.component.spec.ts with the following command which will run all tests in the app folder in a file ending in .spec.ts

```
ng test 
```

![](https://firebootcamp.ghost.io/content/images/2017/01/testing-karma-in-terminal.png)

{% hint style="info" %}
The tests are run in a chrome browser by default and you can see the default ui from Jasmine.
{% endhint %}

![Default Jasmine UI in the Chrome browser](https://4054878242-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKtdWMYFg6DSR3a91Ct%2F-LKtmFx22KWLNOVWgS40%2F-LKtnyElSSaoLGDMhFUz%2Fimage.png?alt=media\&token=63d71e98-7908-4a3c-a7b9-04ef27702a53)

**Figure: Karma out put in terminal**

The default set up is nice and a huge help to get started quickly writing tests in your application but we will also look at wallaby later which can make getting realtime feedback in the IDE much quicker and better.\
The tests that run here are the default tests the Angular CLI create for you. You can and we often do pass a flag in when generating code with the CLI to not auto create tests until we want them as they often break as soon as you inject your first dependency into an Angular component.

```
ng generate component test-component --spec false
```

NOTE: above command will tell the CLI not to auto generate test code for the component being made

* Run the default e2e tests in e2e/app.e2e-spec.ts with the following command which will run all e2e tests in the e2e folder in a file ending in .e2e-spec.ts

```
ng serve 
```

then in another terminal run or it will fail as the application needs to be running for protractor.

{% hint style="info" %}
If you are behind a fire wall you may need to update protractor's webdrivers with the blow commands. You may need to restart VS Code.

```
npm i npx -g
npx webdriver-manager update --ignore_ssl --proxy YOUR_PROXY_ADDRESS
```

{% endhint %}

```
ng e2e
```

![](https://firebootcamp.ghost.io/content/images/2017/01/testing-protractor-in-terminal.png)

**Figure: Protractor out put in terminal**

There is no nice realtime feedback for e2e tests as they are slow to run and normally run on a CI (Continuous integration) setup versus as you code.
