-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
92 additions
and
129 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +1,96 @@ | ||
const helpers = require("./helpers"); | ||
// Helpers | ||
const helpers = require("./scripts/helpers"); | ||
const ciInfo = require("ci-info"); | ||
const isCI = process.argv.indexOf("--watch=false") > -1 || ciInfo.isCI; | ||
|
||
/** | ||
* Load karma config from Stark | ||
*/ | ||
const defaultKarmaConfig = require("./karma-stark.conf.js").rawKarmaConfig; | ||
const ngxFormErrorsSpecificConfiguration = { | ||
// base path that will be used to resolve all patterns (e.g. files, exclude) | ||
basePath: "", | ||
|
||
// start customizing the KarmaCI configuration from stark-testing | ||
const ngxFormErrorsSpecificConfiguration = Object.assign({}, defaultKarmaConfig); | ||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ["jasmine", "@angular-devkit/build-angular"], | ||
|
||
// list of files to exclude | ||
exclude: [ | ||
helpers.root("src/index.html") // not needed for unit testing | ||
], | ||
|
||
client: { | ||
clearContext: false // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
|
||
plugins: [ | ||
// Default karma plugins configuration: require("karma-*") | ||
"karma-*", | ||
require("@angular-devkit/build-angular/plugins/karma") | ||
], | ||
|
||
// test results reporter to use | ||
// possible values: "dots", "progress", "spec", "junit", "mocha", "coverage" (others if you import reporters) | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
// https://www.npmjs.com/package/karma-junit-reporter | ||
// https://www.npmjs.com/package/karma-spec-reporter | ||
reporters: isCI ? ["mocha", "progress"] : ["mocha", "progress", "kjhtml", "coverage"], | ||
|
||
// web server port | ||
port: 9876, | ||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
// level of logging | ||
// see: http://karma-runner.github.io/2.0/config/configuration-file.html | ||
// possible values: | ||
// "OFF" = config.LOG_DISABLE | ||
// "ERROR" = config.LOG_ERROR | ||
// "WARN" = config.LOG_WARN | ||
// "INFO" = config.LOG_INFO | ||
// "DEBUG" = config.LOG_DEBUG | ||
// raw value defined in node_modules/karma/lib/constants.js | ||
logLevel: "WARN", | ||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: isCI ? ["ChromeHeadlessNoSandbox"] : ["Chrome"], | ||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: isCI, | ||
|
||
// If true, tests restart automatically if a file is changed | ||
restartOnFileChange: !isCI, | ||
|
||
// Timeout settings | ||
browserNoActivityTimeout: 30000, | ||
browserDisconnectTolerance: 1, | ||
browserDisconnectTimeout: 30000, | ||
|
||
// Configuration for coverage-istanbul reporter | ||
coverageReporter: { | ||
// base output directory. If you include %browser% in the path it will be replaced with the karma browser name | ||
dir: helpers.root("reports/coverage"), | ||
subdir: ".", | ||
// https://github.com/istanbuljs/istanbuljs/tree/73c25ce79f91010d1ff073aa6ff3fd01114f90db/packages/istanbul-reports/lib | ||
reporters: [{ type: "html" }, { type: "lcovonly" }, { type: "text-summary" }, { type: "clover" }, { type: "json" }] | ||
}, | ||
|
||
// Custom launcher configuration for ChromeHeadless (with Puppeteer) | ||
customLaunchers: { | ||
ChromeHeadlessNoSandbox: { | ||
base: "ChromeHeadless", | ||
// necessary for travis: https://github.com/puppeteer/puppeteer/blob/v7.1.0/docs/troubleshooting.md#setting-up-chrome-linux-sandbox | ||
// as it runs in a container-based environment | ||
flags: ["--no-sandbox", "--disable-setuid-sandbox"] | ||
} | ||
} | ||
}; | ||
|
||
// export the configuration function that karma expects and simply return the stark configuration | ||
module.exports = { | ||
default: function(config) { | ||
default: function (config) { | ||
return config.set(ngxFormErrorsSpecificConfiguration); | ||
} | ||
}; |
File renamed without changes.
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