angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

[Feature Request]: Add support for multi-app lint configurations and e2e tests

Open serhiisol opened this issue 8 years ago • 4 comments

This feature request is about to have an option to specify which app must be checked with lint. Also is about having option to set e2e entry point for multi-app. Multi app can have different e2e scenarios and it seems like current version doesn't support multi-app e2e tests.

Observed behaviour

Currently there is no way how can I specify which app must be checked with lint, .angular-cli.json has array of configurations that will be checked all at once.

Current configuration of .angular-cli.json:

"lint": [
  {
    "project": "src/tsconfig.app.json",
    "exclude": "**/node_modules/**"
  },
  {
    "project": "src/tsconfig.spec.json",
    "exclude": "**/node_modules/**"
  },
  {
    "project": "e2e/tsconfig.e2e.json",
    "exclude": "**/node_modules/**"
  }
]

For e2e only protractor.config.js file has entry point for all the tests. It would be nice to have that option inside .angular-cli.json file, same for specs option:

allScriptsTimeout: 11000,
specs: [
  './e2e/**/*.e2e-spec.ts'
],
onPrepare() {
  require('ts-node').register({
    project: 'e2e/tsconfig.e2e.json'
  });
  jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}

Desired behavior

It would be nice to have .angular-cli.json configuration options for supporting multi-app linting and e2e tests. Proposed app config example:

{
  "root": "src",
  "outDir": "dist",
  "assets": [
    "assets",
    "favicon.ico"
  ],
  "index": "index.html",
  "main": "main.ts",
  "polyfills": "polyfills.ts",
  "test": "test.ts",
  "tsconfig": "tsconfig.app.json",
  "testTsconfig": "tsconfig.spec.json",
  "prefix": "app",
  "styles": [
    "styles.css"
  ],
  "scripts": [],
  "environmentSource": "environments/environment.ts",
  "environments": {
    "dev": "environments/environment.ts",
    "prod": "environments/environment.prod.ts"
  },

  "e2eTsconfig": "tsconfig.e2e.json",
  "e2e": {
    "specs": [
      "./e2e/**/*.e2e-spec.ts"
    ]
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "e2e/tsconfig.e2e.json",
      "exclude": "**/node_modules/**"
    }
  ]
}

Current version

Angular CLI: 1.6.4
Node: 8.2.1
OS: darwin x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

@angular/cli: 1.6.4
@angular-devkit/build-optimizer: 0.0.37
@angular-devkit/core: 0.0.24
@angular-devkit/schematics: 0.0.45
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.4
@schematics/angular: 0.1.12
typescript: 2.5.3
webpack: 3.10.

serhiisol avatar Jan 16 '18 12:01 serhiisol

I suppose, the same should be done for "test" section also.

{
...,
"apps": [
    {
      "name": "dashboard",
      "test": "test.ts",
      ....
  ]
},
"test": {
  "karma": {
     "config": "./karma.conf.js"
  }
},
...

should become something like:

{
....,
"apps": [
    {
      "name": "dashboard",
      "test": {
          "karma": {
               "config": "./karma.conf.js",
               "loader": "test.ts"
           }
       }, 
       ....
],
....
}

vsfedorenko avatar Jan 29 '18 06:01 vsfedorenko

Hi,

SAme request here for linting;

thanks in advance

82antu avatar May 13 '18 15:05 82antu

Support for additional configuration has been added to 6.0 and should cover these scenarios.

clydin avatar Jun 07 '18 17:06 clydin

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.