Skip to content

Commit

Permalink
[CYB-201] [UI][COMPONENT] Fixed Karma Unit tests.
Browse files Browse the repository at this point in the history
* Fixed build action.
  • Loading branch information
vpavlenko-cv committed Mar 20, 2024
1 parent 51dedb0 commit 20f0f92
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ jobs:
run: npm install
working-directory: ./flink-cyber/metron-parser-chain/parser-chains-config-service/frontend/parser-chains-client
- name: Run test
run: npm test
run: npm run test:headless
working-directory: ./flink-cyber/metron-parser-chain/parser-chains-config-service/frontend/parser-chains-client
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start:production": "node scripts/config-app-server.js",
"build": "ng build",
"test": "ng test",
"test:headless": "ng test --karma-config=src/karma.headless.conf.js",
"lint": "ng lint",
"e2e": "ng e2e",
"cypress:open": "cypress open",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
* either express or implied. Refer to the License for the specific permissions and
* limitations governing your use of the file.
*/

// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const path = require('path');

module.exports = function (config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2020 - 2022 Cloudera. All Rights Reserved.
*
* This file is licensed under the Apache License Version 2.0 (the "License"). You may not use this file
* except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. Refer to the License for the specific permissions and
* limitations governing your use of the file.
*/
const path = require("path");
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-spec-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
random: false
}
},
coverageIstanbulReporter: {
dir: path.join(__dirname, '../coverage/enrichment'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['spec'],
port: 9876,
colors: true,
logLevel: config.INFO,
autoWatch: false,
browsers: ['ChromeHeadless'],
singleRun: true,
restartOnFileChange: false
});
};

0 comments on commit 20f0f92

Please sign in to comment.