Skip to content

Multi App Test Command - Doesn't pick up app name #7523

@sethreidnz

Description

@sethreidnz

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.3.0
node: 8.2.0
os: win32 x64
@angular/animations: 4.3.6
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.3.0
@angular/compiler-cli: 4.3.6
@angular/language-service: 4.3.6

Repro steps.

If you put two apps into the generated angular cli project you can suppply the --app parameter and get each app to serve.

However I can't seem to get this to do the same thing with a test the following steps are contained in this repo:

https://github.com/sethreidnz/angular-cli-multi-app-test-repro

But repeated here:

First clone this repo:

git clone https://github.com/sethreidnz/angular-cli-multi-app-test-repro

Install the npm packages:

npm install
``

If you serve them with the following commands they run fine:

```bash
ng serve --app app1
ng serve --app app2

You will see that the apps have different titles, this is the only difference between their files contained in folders /app1 and /app2.

However if you try to run the tests as in the test help command:

ng test -h

With the parameter --app like so:

ng test --sr --app app1
ng test --sr --app app2

You will get the exact same error:

Expected 'APP 1!' to equal 'app'.

Even though they both have a different title property in their respective app/app.component.ts. You would expect the app2 test to have an error like:

Expected 'app 2!' to equal 'app'.

Desired functionality.

Be able to run each projects test by passing the --app parameter equal to the app definition in the .angular-cli.json file.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulseverity3: brokentype: bug/fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions