-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(angular): add support to component and karma project generator f…
…or nested projects (#13380)
- Loading branch information
1 parent
6d35fd4
commit 61f6e2d
Showing
10 changed files
with
231 additions
and
13 deletions.
There are no files selected for viewing
69 changes: 68 additions & 1 deletion
69
packages/angular/src/generators/karma-project/__snapshots__/karma-project.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...karma-project/files/karma.conf.js__tmpl__ → ...roject/files/common/karma.conf.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
packages/angular/src/generators/karma-project/files/root-project/karma.conf.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/6.4/config/configuration-file.html | ||
|
||
const { constants } = require('karma'); | ||
const { join } = require('path'); | ||
|
||
module.exports = (config) => { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage'), | ||
require('@angular-devkit/build-angular/plugins/karma'), | ||
], | ||
client: { | ||
jasmine: { | ||
// you can add configuration options for Jasmine here | ||
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html | ||
// for example, you can disable the random execution with `random: false` | ||
// or set a specific seed with `seed: 4321` | ||
}, | ||
clearContext: false, // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
jasmineHtmlReporter: { | ||
suppressAll: true, // removes the duplicated traces | ||
}, | ||
coverageReporter: { | ||
dir: join(__dirname, 'coverage/<%= projectName %>'), | ||
subdir: '.', | ||
reporters: [{ type: 'html' }, { type: 'text-summary' }], | ||
}, | ||
reporters: ['progress', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: constants.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: true, | ||
restartOnFileChange: true, | ||
}); | ||
}; |
15 changes: 15 additions & 0 deletions
15
...ular/src/generators/karma-project/files/workspace-with-root-project/karma.conf.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/6.4/config/configuration-file.html | ||
|
||
const { join } = require('path'); | ||
const setBaseKarmaConfig = require('<%= offsetFromRoot %>karma.conf'); | ||
|
||
module.exports = function (config) { | ||
setBaseKarmaConfig(config); | ||
|
||
config.set({ | ||
coverageReporter: { | ||
dir: join(__dirname, '<%= offsetFromRoot %>coverage/<%= projectRoot %>') | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters