-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Proposal: app-specific karma config #6008
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort1: easy (hours)featureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort1: easy (hours)featureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Bug Report or Feature Request (mark with an
x)Versions.
@angular/cli: 1.0.0
node: 7.7.4
Problem
This is a proposal to make multiple applications use-case more useful.
Currently,
ng buildandng testsupport an--appoption to choose a specific application fromappsproperty in the CLI options. butkarma.config.jsis accepted at the roottestproperty.Example:
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "name": "multiple-apps" }, "apps": [ { "name": "main", ... "test": "src/main/test.ts" }, { "name": "admin", ... "test": "src/admin/test.ts" } ], "test": { "karma": { "config": "./karma.conf.js" } }, }There is no way to know which app is chosen in karma.conf.js.
Solution
Each application config should accept its own
karmaoption. and roottest.karmaproperty will be a default configuration for karma-undefined apps.{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { "name": "multiple-apps" }, "apps": [ { "name": "main", ... "test": "src/main/test.ts" }, { "name": "admin", ... "test": "src/admin/test.ts", "karma": "./karma.conf.admin.js" } ], "test": { "karma": { "config": "./karma.conf.js" } }, }Note
lintande2ehave the same situation.