diff --git a/packages/stark-rbac/karma.conf.ci.js b/packages/stark-rbac/karma.conf.ci.js index 3701923292..9d3cac497e 100644 --- a/packages/stark-rbac/karma.conf.ci.js +++ b/packages/stark-rbac/karma.conf.ci.js @@ -10,12 +10,17 @@ const karmaTypescriptFiles = require("./karma.conf").karmaTypescriptFiles; // start customizing the KarmaCI configuration from stark-testing const starkRBACSpecificConfiguration = { ...defaultKarmaCIConfig, - // change the module resolution for the KarmaTypescript bundler + // change the path of the report so that Coveralls takes the right path to the source files + coverageIstanbulReporter: { ...defaultKarmaCIConfig.coverageIstanbulReporter, dir: helpers.root("reports/coverage/packages") }, + // add missing files due to "@nationalbankbelgium/stark-rbac" imports used in mock files of the testing sub-package + files: [...defaultKarmaCIConfig.files, ...karmaTypescriptFiles], karmaTypescriptConfig: { ...defaultKarmaCIConfig.karmaTypescriptConfig, bundlerOptions: { ...defaultKarmaCIConfig.karmaTypescriptConfig.bundlerOptions, + // change the module resolution for the KarmaTypescript bundler ...karmaTypescriptBundlerAliasResolution, + // Overwrite the karmaTypescriptConfig to pass the correct preset to karma-typescript-es6-transform transforms: [ require("../stark-testing/node_modules/karma-typescript-angular2-transform"), require("../stark-testing/node_modules/karma-typescript-es6-transform")({ @@ -23,11 +28,7 @@ const starkRBACSpecificConfiguration = { }) ] } - }, - // change the path of the report so that Coveralls takes the right path to the source files - coverageIstanbulReporter: { ...defaultKarmaCIConfig.coverageIstanbulReporter, dir: helpers.root("reports/coverage/packages") }, - // add missing files due to "@nationalbankbelgium/stark-rbac" imports used in mock files of the testing sub-package - files: [...defaultKarmaCIConfig.files, ...karmaTypescriptFiles] + } }; // export the configuration function that karma expects and simply return the stark configuration diff --git a/packages/stark-rbac/karma.conf.js b/packages/stark-rbac/karma.conf.js index 630f0cc7ba..738b24b69d 100644 --- a/packages/stark-rbac/karma.conf.js +++ b/packages/stark-rbac/karma.conf.js @@ -42,12 +42,15 @@ const karmaTypescriptBundlerAliasResolution = { // start customizing the KarmaCI configuration from stark-testing const starkRBACSpecificConfiguration = { ...defaultKarmaConfig, - // change the module resolution for the KarmaTypescript bundler + // add missing files due to "@nationalbankbelgium/stark-rbac" imports used in mock files of the testing sub-package + files: [...defaultKarmaConfig.files, ...karmaTypescriptFiles], karmaTypescriptConfig: { ...defaultKarmaConfig.karmaTypescriptConfig, bundlerOptions: { ...defaultKarmaConfig.karmaTypescriptConfig.bundlerOptions, + // change the module resolution for the KarmaTypescript bundler ...karmaTypescriptBundlerAliasResolution, + // Overwrite the karmaTypescriptConfig to pass the correct preset to karma-typescript-es6-transform transforms: [ require("../stark-testing/node_modules/karma-typescript-angular2-transform"), require("../stark-testing/node_modules/karma-typescript-es6-transform")({ @@ -55,9 +58,7 @@ const starkRBACSpecificConfiguration = { }) ] } - }, - // add missing files due to "@nationalbankbelgium/stark-rbac" imports used in mock files of the testing sub-package - files: [...defaultKarmaConfig.files, ...karmaTypescriptFiles] + } }; // export the configuration function that karma expects and simply return the stark configuration diff --git a/packages/stark-ui/karma.conf.ci.js b/packages/stark-ui/karma.conf.ci.js index e4be9d8a5d..65eda4585c 100644 --- a/packages/stark-ui/karma.conf.ci.js +++ b/packages/stark-ui/karma.conf.ci.js @@ -8,15 +8,21 @@ const karmaTypescriptBundlerAlias = require("./karma.conf").karmaTypescriptBundl const karmaTypescriptFiles = require("./karma.conf").karmaTypescriptFiles; // start customizing the KarmaCI configuration from stark-testing -const starkUiSpecificConfiguration = Object.assign({}, defaultKarmaCIConfig, { - // change the module resolution for the KarmaTypescript bundler +const starkUiSpecificConfiguration = { + ...defaultKarmaCIConfig, + // change the path of the report so that Coveralls takes the right path to the source files + coverageIstanbulReporter: { ...defaultKarmaCIConfig.coverageIstanbulReporter, dir: helpers.root("reports/coverage/packages") }, + // add missing files due to "@nationalbankbelgium/stark-ui" imports used in mock files of the testing sub-package + files: [...defaultKarmaCIConfig.files, ...karmaTypescriptFiles], karmaTypescriptConfig: { ...defaultKarmaCIConfig.karmaTypescriptConfig, bundlerOptions: { ...defaultKarmaCIConfig.karmaTypescriptConfig.bundlerOptions, + // change the module resolution for the KarmaTypescript bundler resolve: { alias: karmaTypescriptBundlerAlias }, + // Overwrite the karmaTypescriptConfig to pass the correct preset to karma-typescript-es6-transform transforms: [ require("../stark-testing/node_modules/karma-typescript-angular2-transform"), require("../stark-testing/node_modules/karma-typescript-es6-transform")({ @@ -24,10 +30,8 @@ const starkUiSpecificConfiguration = Object.assign({}, defaultKarmaCIConfig, { }) ] } - }, - // add missing files due to "@nationalbankbelgium/stark-ui" imports used in mock files of the testing sub-package - files: [...defaultKarmaCIConfig.files, ...karmaTypescriptFiles] -}); + } +}; // export the configuration function that karma expects and simply return the stark configuration module.exports = config => { diff --git a/packages/stark-ui/karma.conf.js b/packages/stark-ui/karma.conf.js index fe81ae548d..b63ed89584 100644 --- a/packages/stark-ui/karma.conf.js +++ b/packages/stark-ui/karma.conf.js @@ -43,15 +43,19 @@ const karmaTypescriptBundlerAlias = { }; // start customizing the KarmaCI configuration from stark-testing -const starkUiSpecificConfiguration = Object.assign({}, defaultKarmaConfig, { - // change the module resolution for the KarmaTypescript bundler +const starkUiSpecificConfiguration = { + ...defaultKarmaConfig, + // add missing files due to "@nationalbankbelgium/stark-ui" imports used in mock files of the testing sub-package + files: [...defaultKarmaConfig.files, ...karmaTypescriptFiles], karmaTypescriptConfig: { ...defaultKarmaConfig.karmaTypescriptConfig, bundlerOptions: { ...defaultKarmaConfig.karmaTypescriptConfig.bundlerOptions, + // change the module resolution for the KarmaTypescript bundler resolve: { alias: karmaTypescriptBundlerAlias }, + // Overwrite the karmaTypescriptConfig to pass the correct preset to karma-typescript-es6-transform transforms: [ require("../stark-testing/node_modules/karma-typescript-angular2-transform"), require("../stark-testing/node_modules/karma-typescript-es6-transform")({ @@ -59,10 +63,8 @@ const starkUiSpecificConfiguration = Object.assign({}, defaultKarmaConfig, { }) ] } - }, - // add missing files due to "@nationalbankbelgium/stark-ui" imports used in mock files of the testing sub-package - files: [...defaultKarmaConfig.files, ...karmaTypescriptFiles] -}); + } +}; // export the configuration function that karma expects and simply return the stark configuration module.exports = {