Dependency Day + Basic Setup #11

Merged
it-as merged 13 commits from dependency-day-basic-setup into main 2024-03-12 17:40:21 +01:00
7 changed files with 7084 additions and 400 deletions
Showing only changes of commit 5de64ebc2a - Show all commits

View File

@ -85,24 +85,6 @@
"options": { "options": {
"buildTarget": "li-dance-backoffice:build" "buildTarget": "li-dance-backoffice:build"
} }
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
} }
} }
} }

View File

@ -1,44 +0,0 @@
// 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/li-dance-backoffice'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,9 @@
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
@ -30,14 +32,26 @@
"@angular-devkit/build-angular": "^17.2.3", "@angular-devkit/build-angular": "^17.2.3",
"@angular/cli": "^17.2.3", "@angular/cli": "^17.2.3",
"@angular/compiler-cli": "^17.2.4", "@angular/compiler-cli": "^17.2.4",
"@types/jasmine": "~3.10.0", "@types/jest": "^29.5.12",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"jasmine-core": "~3.10.0", "jest": "^29.7.0",
"karma": "~6.3.0", "jest-preset-angular": "^14.0.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~5.3.3" "typescript": "~5.3.3"
},
"jest": {
"preset": "jest-preset-angular",
"setupFilesAfterEnv": [
"<rootDir>/src/setup.jest.ts"
],
"testPathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/dist/"
],
"globals": {
"ts-jest": {
"tsConfig": "<rootDir>/tsconfig.spec.json",
"stringifyContentPathRegex": "\\.html$"
}
}
} }
} }

View File

@ -0,0 +1 @@
import 'jest-preset-angular/setup-jest';

View File

@ -1,14 +0,0 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);

View File

@ -4,7 +4,8 @@
"compilerOptions": { "compilerOptions": {
"outDir": "./out-tsc/spec", "outDir": "./out-tsc/spec",
"types": [ "types": [
"jasmine" "jest",
"node"
] ]
}, },
"files": [ "files": [