question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rorticuscommented, Sep 19, 2017

@csaadaam I think you need to include an extra entry for the polyfills,

webpack: {
    entry: {
        main: path.resolve('./app2/src/test.ts'),
        polyfills: [path.resolve('./app2/src/polyfills.ts')]
    }
}
1reaction
rorticuscommented, Sep 18, 2017

I ran into this problem today, it looks like it always takes the first app when building the webpack config for testing,

https://github.com/angular/angular-cli/blob/1.4.x/packages/%40angular/cli/models/webpack-configs/test.ts#L22

I ended up working around this problem by providing another karma.config.js for the second app that overrides the webpack.entry config with the correct entries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up a multi-app kiosk on Windows 10 - Microsoft Learn
Learn how to configure a kiosk device running Windows 10 so that users can only run a few specific apps.
Read more >
Test from the command line | Android Developers
This document describes how to run tests directly from the command line. This document assumes that you already know how to create an ......
Read more >
Spring Boot app: Not picking up application.properties?
Let say you create another property file with different name or you have moved the application.properties file to another folder.
Read more >
Deploying with App Manifests | Cloud Foundry Docs
Overview; Deploy an App with a Manifest; Deploy Multiple Apps with One ... Both manifests and command line options allow you to override...
Read more >
django-admin and manage.py
Run django-admin help <command> to display a description of the given command and a list of its available options. App names¶. Many commands...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found