Skip to content

Commit

Permalink
Refactored karma config to ES Module Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
brok3turtl3 committed Oct 17, 2024
1 parent d008c4d commit 54d55d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
23 changes: 15 additions & 8 deletions angular-resources-page/karma.conf.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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' },
Expand Down
1 change: 1 addition & 0 deletions angular-resources-page/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "angular-contact-page",
"version": "0.0.0",
"type": "module",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down

0 comments on commit 54d55d4

Please sign in to comment.