Skip to content

Commit

Permalink
Merge pull request #485 from mitre-attack/github-action-test
Browse files Browse the repository at this point in the history
GitHub Actions and Test Coverage
  • Loading branch information
jondricek authored Aug 9, 2022
2 parents 87229ae + 797d2a9 commit c227e27
Show file tree
Hide file tree
Showing 30 changed files with 18,495 additions and 2,166 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: npm install and npm run build
- name: npm install, test, build
run: |
cd nav-app/
npm ci
npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage --source-map=false
npm run build
- name: Upload content
uses: actions/upload-artifact@v3
with:
name: App-directory
path: nav-app/dist/

name: App-directory
path: nav-app/dist/
32 changes: 26 additions & 6 deletions nav-app/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ module.exports = function (config) {
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-chrome-launcher'),
require('karma-coverage'),
// require('karma-coverage-istanbul-reporter'),
require('karma-jasmine'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
Expand All @@ -20,13 +21,32 @@ module.exports = function (config) {
fixWebpackSourcePaths: true
},

reporters: ['progress', 'kjhtml'],
reporters: ['progress', 'kjhtml', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
browsers: ['Chrome', 'ChromeHeadlessCI'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
singleRun: false,
webpack: { node: { fs: 'empty', } } //https://github.com/angular/angular-cli/issues/8357
webpack: { node: { fs: 'empty', } }, // https://github.com/angular/angular-cli/issues/8357

// For code coverage
files: [
'src/**/*.ts'
],
preprocessors: {
'src/**/*.js': ['coverage']
},
coverageReporter: {
type : 'html',
dir : 'coverage/'
}

});
};
Loading

0 comments on commit c227e27

Please sign in to comment.