From 0d8bef209592ef1d84d20193def2afed5877a753 Mon Sep 17 00:00:00 2001 From: Merge angular migration to maplibre/mapbox refactor Date: Fri, 20 Dec 2024 16:42:40 +0100 Subject: [PATCH] Karma is real? --- angular.json | 8 +-- karma.conf.js | 22 ++++++--- projects/arlas-components/karma.conf.js | 63 ------------------------ projects/arlas-map/karma.conf.js | 63 ------------------------ projects/arlas-mapbox/karma.conf.js | 64 ------------------------ projects/arlas-maplibre/karma.conf.js | 65 ------------------------- 6 files changed, 18 insertions(+), 267 deletions(-) delete mode 100644 projects/arlas-components/karma.conf.js delete mode 100644 projects/arlas-map/karma.conf.js delete mode 100644 projects/arlas-mapbox/karma.conf.js delete mode 100644 projects/arlas-maplibre/karma.conf.js diff --git a/angular.json b/angular.json index 730eaa64..cad0b026 100644 --- a/angular.json +++ b/angular.json @@ -155,7 +155,7 @@ "options": { "main": "projects/arlas-components/src/test.ts", "tsConfig": "projects/arlas-components/tsconfig.spec.json", - "karmaConfig": "projects/arlas-components/karma.conf.js", + "karmaConfig": "./karma.conf.js", "styles": [ "src/styles.css", "node_modules/iv-viewer/dist/iv-viewer.css" @@ -201,7 +201,7 @@ "options": { "main": "projects/arlas-mapbox/src/test.ts", "tsConfig": "projects/arlas-mapbox/tsconfig.spec.json", - "karmaConfig": "projects/arlas-mapbox/karma.conf.js" + "karmaConfig": "./karma.conf.js" } }, "lint": { @@ -243,7 +243,7 @@ "options": { "main": "projects/arlas-maplibre/src/test.ts", "tsConfig": "projects/arlas-maplibre/tsconfig.spec.json", - "karmaConfig": "projects/arlas-maplibre/karma.conf.js" + "karmaConfig": "./karma.conf.js" } }, "lint": { @@ -285,7 +285,7 @@ "options": { "main": "projects/arlas-map/src/test.ts", "tsConfig": "projects/arlas-map/tsconfig.spec.json", - "karmaConfig": "projects/arlas-map/karma.conf.js" + "karmaConfig": "./karma.conf.js" } }, "lint": { diff --git a/karma.conf.js b/karma.conf.js index 0cf66e67..29d3c31e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -5,13 +5,7 @@ module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') - ], + plugins, client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser }, @@ -19,6 +13,7 @@ module.exports = function (config) { dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, + webpack: { node: { fs: 'empty', } }, reporters: ['progress', 'kjhtml'], port: 9876, @@ -27,6 +22,17 @@ module.exports = function (config) { autoWatch: true, browsers: ['ChromeHeadless'], singleRun: true, - webpack: { node: { fs: 'empty', } } }); }; + +const plugins = [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') +] + + + + diff --git a/projects/arlas-components/karma.conf.js b/projects/arlas-components/karma.conf.js deleted file mode 100644 index ec984aef..00000000 --- a/projects/arlas-components/karma.conf.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to Gisaïa under one or more contributor - * license agreements. See the NOTICE.txt file distributed with - * this work for additional information regarding copyright - * ownership. Gisaïa licenses this file to you 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 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - jasmine: { - // you can add configuration options for Jasmine here - // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html - // for example, you can disable the random execution with `random: false` - // or set a specific seed with `seed: 4321` - }, - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces - }, - coverageReporter: { - dir: require('path').join(__dirname, '../../coverage/arlas-components'), - subdir: '.', - reporters: [ - { type: 'html' }, - { type: 'text-summary' } - ] - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['ChromeHeadless'], - singleRun: true, - restartOnFileChange: true - }); -}; diff --git a/projects/arlas-map/karma.conf.js b/projects/arlas-map/karma.conf.js deleted file mode 100644 index d6f75438..00000000 --- a/projects/arlas-map/karma.conf.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to Gisaïa under one or more contributor - * license agreements. See the NOTICE.txt file distributed with - * this work for additional information regarding copyright - * ownership. Gisaïa licenses this file to you 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 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - jasmine: { - // you can add configuration options for Jasmine here - // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html - // for example, you can disable the random execution with `random: false` - // or set a specific seed with `seed: 4321` - }, - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces - }, - coverageReporter: { - dir: require('path').join(__dirname, '../../coverage/arlas-map'), - subdir: '.', - reporters: [ - { type: 'html' }, - { type: 'text-summary' } - ] - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['ChromeHeadless'], - singleRun: true, - restartOnFileChange: true - }); -}; diff --git a/projects/arlas-mapbox/karma.conf.js b/projects/arlas-mapbox/karma.conf.js deleted file mode 100644 index ad033246..00000000 --- a/projects/arlas-mapbox/karma.conf.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to Gisaïa under one or more contributor - * license agreements. See the NOTICE.txt file distributed with - * this work for additional information regarding copyright - * ownership. Gisaïa licenses this file to you 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 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - jasmine: { - // you can add configuration options for Jasmine here - // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html - // for example, you can disable the random execution with `random: false` - // or set a specific seed with `seed: 4321` - }, - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces - }, - coverageReporter: { - dir: require('path').join(__dirname, '../../coverage/arlas-mapbox'), - subdir: '.', - reporters: [ - { type: 'html' }, - { type: 'text-summary' } - ] - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['ChromeHeadless'], - singleRun: true, - restartOnFileChange: true - }); -}; diff --git a/projects/arlas-maplibre/karma.conf.js b/projects/arlas-maplibre/karma.conf.js deleted file mode 100644 index f7841740..00000000 --- a/projects/arlas-maplibre/karma.conf.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to Gisaïa under one or more contributor - * license agreements. See the NOTICE.txt file distributed with - * this work for additional information regarding copyright - * ownership. Gisaïa licenses this file to you 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 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -//NOSONAR - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - jasmine: { - // you can add configuration options for Jasmine here - // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html - // for example, you can disable the random execution with `random: false` - // or set a specific seed with `seed: 4321` - }, - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - jasmineHtmlReporter: { - suppressAll: true // removes the duplicated traces - }, - coverageReporter: { - dir: require('path').join(__dirname, '../../coverage/arlas-maplibre'), - subdir: '.', - reporters: [ - { type: 'html' }, - { type: 'text-summary' } - ] - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['ChromeHeadless'], - singleRun: true, - restartOnFileChange: true - }); -};