diff --git a/angular-resources-page/karma.conf.js b/angular-resources-page/karma.conf.js index 8357cf5..5de6883 100644 --- a/angular-resources-page/karma.conf.js +++ b/angular-resources-page/karma.conf.js @@ -1,16 +1,23 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html -module.exports = function (config) { +import { join } from 'path'; +import karmaJasmine from 'karma-jasmine'; +import karmaChromeLauncher from 'karma-chrome-launcher'; +import karmaJasmineHtmlReporter from 'karma-jasmine-html-reporter'; +import karmaCoverage from 'karma-coverage'; +import { buildAngularPlugin } from '@angular-devkit/build-angular/plugins/karma'; + +export default function (config) { config.set({ basePath: '', - frameworks: ['jasmine', '@angular-devkit/build-angular'], + frameworks: ['jasmine', buildAngularPlugin], plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage'), - require('@angular-devkit/build-angular/plugins/karma') + karma-jasmine, + karma-chrome-launcher, + karma-jasmine-html-reporter, + karma-coverage, + @angular-devkit/build-angular/plugins/karma ], client: { jasmine: { @@ -25,7 +32,7 @@ module.exports = function (config) { suppressAll: true // removes the duplicated traces }, coverageReporter: { - dir: require('path').join(__dirname, './coverage/angular-contact-page'), + dir: join(__dirname, './coverage/angular-contact-page'), subdir: '.', reporters: [ { type: 'html' }, diff --git a/angular-resources-page/package.json b/angular-resources-page/package.json index 396ae8f..a7f4def 100644 --- a/angular-resources-page/package.json +++ b/angular-resources-page/package.json @@ -1,6 +1,7 @@ { "name": "angular-contact-page", "version": "0.0.0", + "type": "module", "scripts": { "ng": "ng", "start": "ng serve",