Skip to content

Commit

Permalink
feat(a17): correct configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Nov 19, 2023
1 parent 3c87c35 commit 4406ce9
Show file tree
Hide file tree
Showing 11 changed files with 4,778 additions and 15,942 deletions.
4 changes: 4 additions & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

git update-index --again
10 changes: 1 addition & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": [
"src/polyfills.ts",
"zone.js",
"zone.js/testing",
"jasmine-core/lib/jasmine-core/jasmine.js",
"jasmine-core/lib/jasmine-core/jasmine-html.js",
"jasmine-core/lib/jasmine-core/boot0.js",
"jasmine-core/lib/jasmine-core/boot1.js"
],
"polyfills": ["core-js/proposals/reflect-metadata", "zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js"
}
Expand Down
25 changes: 14 additions & 11 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

if (process.env.CSB === undefined) {
const isCSB = !!process.env.CSB;
const isLocal = !isCSB;
const withCoverage = !isCSB && !!process.env.WITH_COVERAGE;

if (isLocal) {
process.env.CHROME_BIN = require('puppeteer').executablePath();
}

Expand All @@ -11,9 +15,9 @@ module.exports = function (config) {
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-ie-launcher'),
require('karma-junit-reporter'),
...(isLocal
? [require('karma-chrome-launcher'), require('karma-ie-launcher'), require('karma-junit-reporter')]
: []),
require('karma-jasmine-html-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
Expand All @@ -38,15 +42,14 @@ module.exports = function (config) {
outputFile: 'specs-junit.xml',
useBrowserName: false,
},
reporters:
process.env.CSB === undefined && process.env.WITH_COVERAGE !== undefined ? ['junit'] : ['kjhtml', 'dots'],
hostname: undefined,
listenAddress: process.env.CSB === undefined ? 'localhost' : '0.0.0.0',
reporters: withCoverage ? ['junit'] : ['dots', 'kjhtml'],
hostname: isCSB ? 'codesandbox.io' : 'localhost',
listenAddress: isCSB ? '0.0.0.0' : 'localhost',
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: process.env.CSB !== undefined,
browsers: process.env.CSB === undefined ? ['ChromeCi'] : [],
singleRun: process.env.CSB === undefined,
autoWatch: isCSB,
browsers: isCSB ? [] : ['ChromeCi'],
singleRun: isLocal,
});
};
Loading

0 comments on commit 4406ce9

Please sign in to comment.