From 86ae2f5c2b1c8d0ffc6926cbfbb003881c1bce0b Mon Sep 17 00:00:00 2001 From: Maurizio Vitale Date: Tue, 27 Nov 2018 21:11:37 +0000 Subject: [PATCH] [ADF-3789] Fix the content service coverage path and config (#4010) * Fix the content service coverage path and config * Use relative path --- angular.json | 2 +- lib/content-services/karma.conf.js | 46 +++++++++++++----------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/angular.json b/angular.json index 0caf516951..d2a4fc56df 100644 --- a/angular.json +++ b/angular.json @@ -575,7 +575,7 @@ }, "content-services": { "root": "lib/content-services", - "sourceRoot": "lib/content-services/src", + "sourceRoot": "lib/content-services", "projectType": "library", "prefix": "adf", "architect": { diff --git a/lib/content-services/karma.conf.js b/lib/content-services/karma.conf.js index abe03142cf..6cb169b101 100644 --- a/lib/content-services/karma.conf.js +++ b/lib/content-services/karma.conf.js @@ -3,40 +3,38 @@ module.exports = function (config) { config.set({ - basePath: '../../', + basePath: '', files: [ - {pattern: 'node_modules/core-js/client/core.js', included: true, watched: false}, - {pattern: 'node_modules/tslib/tslib.js', included: true, watched: false}, - {pattern: 'node_modules/hammerjs/hammer.min.js', included: true, watched: false}, - {pattern: 'node_modules/hammerjs/hammer.min.js.map', included: false, watched: false}, + {pattern: '../../node_modules/core-js/client/core.js', included: true, watched: false}, + {pattern: '../../node_modules/tslib/tslib.js', included: true, watched: false}, + {pattern: '../../node_modules/hammerjs/hammer.min.js', included: true, watched: false}, + {pattern: '../../node_modules/hammerjs/hammer.min.js.map', included: false, watched: false}, // pdf-js - {pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false}, - {pattern: 'node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false}, - {pattern: 'node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false}, + {pattern: '../../node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false}, + {pattern: '../../node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false}, + {pattern: '../../node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false}, { - pattern: 'node_modules/@angular/material/prebuilt-themes/indigo-pink.css', + pattern: '../../node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: false }, - {pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.min.js', included: true, watched: false}, - {pattern: 'node_modules/moment/min/moment.min.js', included: true, watched: false}, + {pattern: '../../node_modules/alfresco-js-api/dist/alfresco-js-api.min.js', included: true, watched: false}, + {pattern: '../../node_modules/moment/min/moment.min.js', included: true, watched: false}, - {pattern: 'lib/content-services/i18n/**/en.json', included: false, served: true, watched: false}, - {pattern: 'lib/core/i18n/**/en.json', included: false, served: true, watched: false}, - - {pattern: 'lib/content-services/**/*.ts', included: false, served: true, watched: false}, - - {pattern: 'lib/config/app.config.json', included: false, served: true, watched: false}, + {pattern: '../content-services/i18n/**/en.json', included: false, served: true, watched: false}, + {pattern: '../core/i18n/**/en.json', included: false, served: true, watched: false}, + {pattern: '../content-services/**/*.ts', included: false, served: true, watched: false}, + {pattern: '../config/app.config.json', included: false, served: true, watched: false}, ], frameworks: ['jasmine-ajax', 'jasmine', '@angular-devkit/build-angular'], proxies: { - '/base/assets/' :'/base/lib/content-services/assets/', + '/base/assets/': '/base/lib/content-services/assets/', '/assets/adf-content-services/i18n/en.json': '/base/lib/content-services/i18n/en.json', '/assets/adf-core/i18n/en.json': '/base/lib/core/i18n/en.json', '/app.config.json': '/base/lib/config/app.config.json', @@ -56,18 +54,11 @@ module.exports = function (config) { }, coverageIstanbulReporter: { - dir: './lib/coverage/content-services/', + dir: require('path').join(__dirname, '../coverage/content-services'), reports: ['html', 'lcovonly'], fixWebpackSourcePaths: true }, - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - colors: true, - - autoWatch: false, - browserDisconnectTimeout: 200000, browserNoActivityTimeout: 2400000, captureTimeout: 1200000, @@ -86,6 +77,9 @@ module.exports = function (config) { reporters: ['mocha', 'kjhtml'], port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, browsers: ['Chrome'], singleRun: false });