Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ speed-measure-plugin.json
# misc
/.sass-cache
/connect.lock
/coverage
.coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"ng": "npx ng",
"start": "npx ng serve --host 0.0.0.0",
"build": "npx ng build",
"test": "npx ng test --code-coverage",
"test:cli": "npx ng test --karma-config=src/karma/karma-cli.conf.js --code-coverage",
"test:ci": "npx ng test --karma-config=src/karma/karma-ci.conf.js --code-coverage",
"test": "npx ng test --karma-config=src/karma/karma-cli.conf.js --code-coverage",
"test:debug": "npx ng test --code-coverage",
"test:ci": "npx ng test --karma-config=src/karma/karma-ci.conf.js --code-coverage --progress false; [ $? -eq '0' ] && echo 'Completed Successfully.' || echo 'Test(s) Failed!';",
"test:coverage": "npx ng test --karma-config=src/karma/karma-coverage.conf.js --code-coverage --progress false",
"lint": "npx ng lint --lint-file-patterns=src/app/**/*.ts",
"format": "npx prettier 'src/**/*.{ts,tsx}' --write",
"gh-pages:build": "npm run gh-pages:clean && npm run gh-pages:bundle && npm run gh-pages:deploy",
Expand Down
13 changes: 7 additions & 6 deletions src/karma/karma-ci.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ const { conf } = require('./karma-conf-obj');
let reporters = ['coverage', 'fail-fast'];
conf.reporters = reporters;
conf.failOnFailingTestSuite = true;
conf.failOnSkippedTests = true;
conf.failOnSkippedTests = false;
conf.logLevel = 'FATAL';
conf.plugins.push(require('karma-fail-fast-reporter'))
conf.coverageReporter.reporters.push({ type: 'lcov' });
module.exports = function (config) {
config.LOG_LOG = 'WARN';
// config.LOG_LOG = 'OFF';
// config.failOnFailingTestSuite = true;
// config.failOnSkippedTests = true;
(conf.logLevel = config.LOG_LOG), config.set(conf);
const c = {};
Object.assign(c, config, conf);
config.set(c);
};
9 changes: 6 additions & 3 deletions src/karma/karma-cli.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const { conf } = require('./karma-conf-obj');
let reporters = ['coverage', 'verbose'];
let reporters = ['coverage', 'progress'];
conf.reporters = reporters;
conf.logLevel = 'WARN';
conf.coverageReporter.reporters.push({ type: 'text-summary' });
module.exports = function (config) {
config.LOG_LOG = 'OFF';
(conf.logLevel = config.LOG_LOG), config.set(conf);
const c = {};
Object.assign(c, config, conf);
config.set(c);
};
13 changes: 4 additions & 9 deletions src/karma/karma-conf-obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports.conf = {
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-verbose-reporter'),
require('karma-typescript'),
require('karma-coverage'),
require('karma-fail-fast-reporter')
require('karma-coverage')
],
preprocessors: {
'**/*.ts': ['karma-typescript', 'coverage'],
Expand All @@ -33,13 +32,9 @@ module.exports.conf = {
}
},
coverageReporter: {
dir: require('path').join(__dirname, '../coverage'),
dir: require('path').join(__dirname, '../../.coverage'),
subdir: '.',
reporters: [
{ type: 'lcovonly' },
{ type: 'text-summary' },
{ type: 'text' }
],
reporters: [],
fixWebpackSourcePaths: true
},
browserConsoleLogOptions: {
Expand Down Expand Up @@ -67,7 +62,7 @@ module.exports.conf = {
],
browserDisconnectTimeout: 280000,
browserNoActivityTimeout: 280000,
browserDisconnectTolerance : 1
browserDisconnectTolerance : 3
}
}
/** ** /
Expand Down
13 changes: 13 additions & 0 deletions src/karma/karma-coverage.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { conf } = require('./karma-conf-obj');
let reporters = ['coverage', 'fail-fast'];
conf.reporters = reporters;
conf.failOnFailingTestSuite = true;
conf.failOnSkippedTests = false;
conf.logLevel = 'OFF';
conf.plugins.push(require('karma-fail-fast-reporter'))
conf.coverageReporter.reporters.push({ type: 'text' });
module.exports = function (config) {
const c = {};
Object.assign(c, config, conf);
config.set(c);
};
8 changes: 6 additions & 2 deletions src/karma/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
let { conf } = require('./karma-conf-obj');
let reporters = ['coverage', 'verbose', 'progress'];
conf.reporters = reporters;
conf.logLevel = 'INFO';
conf.coverageReporter.reporters.push({ type: 'text-summary' });
conf.coverageReporter.reporters.push({ type: 'text' });
module.exports = function (config) {
config.LOG_LOG = 'WARN';
(conf.logLevel = config.LOG_LOG), config.set(conf);
const c = {};
Object.assign(c, config, conf);
config.set(c);
}