Tests run again. Regenerated all with angular 17.

This commit is contained in:
Manuel Friedli 2024-01-22 02:37:28 +01:00
parent 59cb96f426
commit d8e4c7689f
Signed by: manuel
GPG key ID: 41D08ABA75634DA1
51 changed files with 704 additions and 3998 deletions

View file

@ -1,7 +1,9 @@
<div *ngFor="let step of steps" class="inputwrapper">
<app-text-input-field [step]="step" #ti></app-text-input-field>
<app-converter-selector [step]="step" [textInput]="ti"></app-converter-selector>
<app-error-message [step]="step"></app-error-message>
</div>
@for (step of steps; track step.index) {
<div class="inputwrapper">
<app-text-input-field [step]="step" #ti></app-text-input-field>
<app-converter-selector [step]="step" [textInput]="ti"></app-converter-selector>
<app-error-message [step]="step"></app-error-message>
</div>
}
<app-version></app-version>
<!--<router-outlet></router-outlet>-->

View file

@ -1,39 +1,26 @@
import {AppComponent} from './app.component';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {FormsModule} from '@angular/forms';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {Step} from './step';
import {VersionComponent} from './version/version.component';
import {ConverterSelectorComponent} from './converter-selector/converter-selector.component';
import {TextInputFieldComponent} from './text-input-field/text-input-field.component';
import {ErrorMessageComponent} from './error-message/error-message.component';
describe('AppComponent', () => {
let sut: AppComponent;
let fixture: ComponentFixture<AppComponent>;
const firstStep: Step = new Step(0);
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent,
ConverterSelectorComponent,
ErrorMessageComponent,
TextInputFieldComponent,
VersionComponent
],
imports: [FormsModule]
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent]
})
.compileComponents();
}));
});
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
sut = fixture.componentInstance;
});
it('should create the app', async(() => {
it('should create the app', () => {
// const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
expect(sut).toBeTruthy();
});
});

View file

@ -1,11 +1,24 @@
import {Component, OnInit} from '@angular/core';
import {InputComponentManagerService} from './input-component-manager.service';
import {Step} from './step';
import {RouterOutlet} from '@angular/router';
import {TextInputFieldComponent} from './text-input-field/text-input-field.component';
import {ConverterSelectorComponent} from './converter-selector/converter-selector.component';
import {ErrorMessageComponent} from './error-message/error-message.component';
import {VersionComponent} from './version/version.component';
@Component({
selector: 'app-root',
standalone: true,
imports: [
ConverterSelectorComponent,
ErrorMessageComponent,
RouterOutlet,
TextInputFieldComponent,
VersionComponent
],
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrl: './app.component.scss'
})
export class AppComponent implements OnInit {
public steps: Step[] = [];

8
src/app/app.config.ts Normal file
View file

@ -0,0 +1,8 @@
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes)]
};

View file

@ -12,11 +12,11 @@ import { ErrorMessageComponent } from './error-message/error-message.component';
@NgModule({
declarations: [
AppComponent,
VersionComponent,
TextInputFieldComponent,
ConverterSelectorComponent,
ErrorMessageComponent
// AppComponent,
// VersionComponent,
// TextInputFieldComponent,
// ConverterSelectorComponent,
// ErrorMessageComponent
],
imports: [
BrowserModule,
@ -27,7 +27,7 @@ import { ErrorMessageComponent } from './error-message/error-message.component';
InputComponentManagerService,
NativeLibraryWrapperService
],
bootstrap: [AppComponent]
// bootstrap: [AppComponent]
})
export class AppModule {
}

3
src/app/app.routes.ts Normal file
View file

@ -0,0 +1,3 @@
import { Routes } from '@angular/router';
export const routes: Routes = [];

View file

@ -35,7 +35,7 @@ export class ConverterRegistryService {
return this.converters;
}
public getConverter(id: string): Converter {
public getConverter(id: string): Converter | undefined {
return this.converters.find((converter: Converter): boolean => converter.getId() === id);
}

View file

@ -2,8 +2,9 @@
<div class="arrow_box">
<select class="select" (change)="convert($event)">
<option id="undefined">Select conversion ...</option>
<option class="option" *ngFor="let c of converters" id="{{c.getId()}}">{{c.getDisplayname()}}
</option>
@for (c of converters; track c.getId()) {
<option class="option" id="{{c.getId()}}">{{ c.getDisplayname() }}</option>
}
</select>
</div>
</div>

View file

@ -1,4 +1,4 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ConverterSelectorComponent} from './converter-selector.component';
import {Component, ViewChild} from '@angular/core';
@ -17,7 +17,7 @@ class TestHostComponent {
public step: Step = new Step(42);
public textInputComponent: TextInputFieldComponent = new TextInputFieldComponent(inputComponentManagerServiceStub);
@ViewChild(ConverterSelectorComponent)
public sutComponent: ConverterSelectorComponent;
public sutComponent!: ConverterSelectorComponent;
}
const inputComponentManagerServiceStub = createSpyObj(['getNext']);
@ -39,10 +39,10 @@ describe('ConverterSelectorComponent', () => {
converterRegistryServiceStub.getAllConverters.and.returnValue([converter1, converter2, converter3]);
converterRegistryServiceStub.getConverter.and.returnValue(undefined);
beforeEach(async(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ConverterSelectorComponent],
declarations: [
ConverterSelectorComponent,
TestHostComponent
],
providers: [
@ -51,7 +51,7 @@ describe('ConverterSelectorComponent', () => {
]
})
.compileComponents();
}));
});
beforeEach(() => {
testHostFixture = TestBed.createComponent(TestHostComponent);
@ -59,7 +59,7 @@ describe('ConverterSelectorComponent', () => {
testHostFixture.detectChanges();
});
it('should create', () => {
it('should create the component', () => {
expect(testHostComponent.sutComponent).toBeTruthy();
});

View file

@ -3,17 +3,20 @@ import {Step} from '../step';
import {Converter} from '../converter/converter';
import {ConverterRegistryService} from '../converter-registry.service';
import {TextInputFieldComponent} from '../text-input-field/text-input-field.component';
import {CommonModule} from '@angular/common';
@Component({
selector: 'app-converter-selector',
templateUrl: './converter-selector.component.html',
styleUrls: ['./converter-selector.component.scss']
standalone: true,
styleUrls: ['./converter-selector.component.scss'],
imports: [CommonModule]
})
export class ConverterSelectorComponent implements OnInit {
@Input()
public step: Step;
public step!: Step;
@Input()
private textInput: TextInputFieldComponent;
textInput!: TextInputFieldComponent;
public converters: Converter[] = [];
constructor(private converterRegistryService: ConverterRegistryService) {

View file

@ -1,5 +1,5 @@
import {PunycodeDecoder} from './punycode-decoder';
import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
import {NativeLibraryWrapperService, Punycode} from '../native-library-wrapper.service';
import createSpyObj = jasmine.createSpyObj;
import Spy = jasmine.Spy;
@ -9,8 +9,8 @@ describe('PunycodeDecoder', () => {
let decodeSpy: Spy;
beforeEach(() => {
nativeWrapperSpy = {punycode: createSpyObj(['decode'])};
decodeSpy = nativeWrapperSpy.punycode.decode as Spy;
nativeWrapperSpy = {punycode: createSpyObj<Punycode>(['decode'])};
decodeSpy = nativeWrapperSpy.punycode!.decode as Spy;
sut = new PunycodeDecoder((nativeWrapperSpy as NativeLibraryWrapperService));
});

View file

@ -1,4 +1,4 @@
import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
import {NativeLibraryWrapperService, Punycode} from '../native-library-wrapper.service';
import {PunycodeEncoder} from './punycode-encoder';
import createSpyObj = jasmine.createSpyObj;
import Spy = jasmine.Spy;
@ -9,8 +9,8 @@ describe('PunycodeEncoder', () => {
let encodeSpy: Spy;
beforeEach(() => {
nativeWrapperSpy = {punycode: createSpyObj(['encode'])};
encodeSpy = nativeWrapperSpy.punycode.encode as Spy;
nativeWrapperSpy = {punycode: createSpyObj<Punycode>(['encode'])};
encodeSpy = nativeWrapperSpy.punycode!.encode as Spy;
sut = new PunycodeEncoder(nativeWrapperSpy as NativeLibraryWrapperService);
});

View file

@ -1,4 +1,4 @@
import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
import {NativeLibraryWrapperService, QuotedPrintable} from '../native-library-wrapper.service';
import {QuotedPrintableDecoder} from './quoted-printable-decoder';
import createSpyObj = jasmine.createSpyObj;
import Spy = jasmine.Spy;
@ -9,8 +9,8 @@ describe('QuotedPrintableDecoder', () => {
let decodeSpy: Spy;
beforeEach(() => {
nativeWrapperSpy = {quotedPrintable: createSpyObj(['decode'])};
decodeSpy = nativeWrapperSpy.quotedPrintable.decode as Spy;
nativeWrapperSpy = {quotedPrintable: createSpyObj<QuotedPrintable>(['decode'])};
decodeSpy = nativeWrapperSpy.quotedPrintable!.decode as Spy;
sut = new QuotedPrintableDecoder((nativeWrapperSpy as NativeLibraryWrapperService));
});

View file

@ -1,4 +1,4 @@
import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
import {NativeLibraryWrapperService, QuotedPrintable} from '../native-library-wrapper.service';
import {QuotedPrintableEncoder} from './quoted-printable-encoder';
import createSpyObj = jasmine.createSpyObj;
import Spy = jasmine.Spy;
@ -9,8 +9,8 @@ describe('QuotedPrintableEncoder', () => {
let encodeSpy: Spy;
beforeEach(() => {
nativeWrapperSpy = {quotedPrintable: createSpyObj(['encode'])};
encodeSpy = nativeWrapperSpy.quotedPrintable.encode as Spy;
nativeWrapperSpy = {quotedPrintable: createSpyObj<QuotedPrintable>(['encode'])};
encodeSpy = nativeWrapperSpy.quotedPrintable!.encode as Spy;
sut = new QuotedPrintableEncoder(nativeWrapperSpy as NativeLibraryWrapperService);
});

View file

@ -13,7 +13,7 @@ export class ROT13Converter implements Converter {
try {
const inChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
const outChars = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm';
const translate = c => {
const translate = (c: string) => {
const charIndex = inChars.indexOf(c);
return charIndex > -1 ? outChars[charIndex] : c;
};

View file

@ -1,4 +1,4 @@
import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
import {NativeLibraryWrapperService, Utf8} from '../native-library-wrapper.service';
import {UTF8Decoder} from './utf8-decoder';
import createSpyObj = jasmine.createSpyObj;
import Spy = jasmine.Spy;
@ -9,8 +9,8 @@ describe('UTF8Decoder', () => {
let decodeSpy: Spy;
beforeEach(() => {
nativeWrapperSpy = {utf8: createSpyObj(['decode'])};
decodeSpy = nativeWrapperSpy.utf8.decode as Spy;
nativeWrapperSpy = {utf8: createSpyObj<Utf8>(['decode'])};
decodeSpy = nativeWrapperSpy.utf8!.decode as Spy;
sut = new UTF8Decoder((nativeWrapperSpy as NativeLibraryWrapperService));
});

View file

@ -1,4 +1,4 @@
import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
import {NativeLibraryWrapperService, Utf8} from '../native-library-wrapper.service';
import {UTF8Encoder} from './utf8-encoder';
import createSpyObj = jasmine.createSpyObj;
import Spy = jasmine.Spy;
@ -9,8 +9,8 @@ describe('UTF8Encoder', () => {
let encodeSpy: Spy;
beforeEach(() => {
nativeWrapperSpy = {utf8: createSpyObj(['encode'])};
encodeSpy = nativeWrapperSpy.utf8.encode as Spy;
nativeWrapperSpy = {utf8: createSpyObj<Utf8>(['encode'])};
encodeSpy = nativeWrapperSpy.utf8!.encode as Spy;
sut = new UTF8Encoder(nativeWrapperSpy as NativeLibraryWrapperService);
});

View file

@ -1 +1,3 @@
<div class="errormessage" *ngIf="step.error" [innerHTML]="step.message"></div>
@if (step.error) {
<div class="errormessage" [innerHTML]="step.message"></div>
}

View file

@ -1,4 +1,4 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ErrorMessageComponent} from './error-message.component';
import {Component, ViewChild} from '@angular/core';
@ -10,22 +10,20 @@ import {Step} from '../step';
class TestHostComponent {
public step: Step = new Step(42);
@ViewChild(ErrorMessageComponent)
public sutComponent: ErrorMessageComponent;
public sutComponent!: ErrorMessageComponent;
}
describe('ErrorMessageComponent', () => {
let testHostComponent: TestHostComponent;
let testHostFixture: ComponentFixture<TestHostComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
ErrorMessageComponent,
TestHostComponent
]
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ErrorMessageComponent],
declarations: [TestHostComponent]
})
.compileComponents();
}));
});
beforeEach(() => {
testHostFixture = TestBed.createComponent(TestHostComponent);

View file

@ -2,13 +2,14 @@ import {Component, Input} from '@angular/core';
import {Step} from '../step';
@Component({
selector: 'app-error-message',
templateUrl: './error-message.component.html',
styleUrls: ['./error-message.component.scss']
selector: 'app-error-message',
templateUrl: './error-message.component.html',
standalone: true,
styleUrls: ['./error-message.component.scss']
})
export class ErrorMessageComponent {
@Input()
public step: Step;
public step!: Step;
constructor() {
}

View file

@ -24,12 +24,12 @@ describe('InputComponentManagerService', () => {
);
it('must not add a null Step', inject([InputComponentManagerService], (service: InputComponentManagerService) => {
expect(() => service.register(null)).toThrowError();
expect(() => service.register(null!)).toThrowError();
expect(service.getAllComponents().length).toEqual(0);
}));
it('must not add an undefined Step', inject([InputComponentManagerService], (service: InputComponentManagerService) => {
expect(() => service.register(undefined)).toThrowError();
expect(() => service.register(undefined!)).toThrowError();
expect(service.getAllComponents().length).toEqual(0);
}));

View file

@ -18,19 +18,19 @@ export class NativeLibraryWrapperService {
}
}
interface Punycode {
export interface Punycode {
encode(input: string): string;
decode(input: string): string;
}
interface QuotedPrintable {
export interface QuotedPrintable {
encode(input: string): string;
decode(input: string): string;
}
interface Utf8 {
export interface Utf8 {
encode(input: any): string;
decode(input: string): any;

View file

@ -2,7 +2,7 @@ import {Converter} from './converter/converter';
export class Step {
public content = '';
public selectedConverter: Converter = undefined;
public selectedConverter: Converter | undefined;
public index: number;
public error = false;
public message = '';

View file

@ -1,4 +1,4 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {TextInputFieldComponent} from './text-input-field.component';
import {Step} from '../step';
@ -13,7 +13,7 @@ import createSpyObj = jasmine.createSpyObj;
class TestHostComponent {
public step: Step = new Step(42);
@ViewChild(TextInputFieldComponent)
public sutComponent: TextInputFieldComponent;
public sutComponent!: TextInputFieldComponent;
}
describe('TextInputFieldComponent', () => {
@ -23,17 +23,16 @@ describe('TextInputFieldComponent', () => {
const inputComponentManagerServiceStub = createSpyObj(['getNext']);
inputComponentManagerServiceStub.getNext.and.returnValue(undefined);
beforeEach(async(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
TestHostComponent,
TextInputFieldComponent
TestHostComponent
],
imports: [FormsModule],
imports: [TextInputFieldComponent, FormsModule],
providers: [{provide: InputComponentManagerService, useValue: inputComponentManagerServiceStub}]
})
.compileComponents();
}));
});
beforeEach(() => {
testHostFixture = TestBed.createComponent(TestHostComponent);
@ -41,7 +40,7 @@ describe('TextInputFieldComponent', () => {
testHostFixture.detectChanges();
});
it('should create', () => {
it('should create the component', () => {
expect(testHostComponent.sutComponent).toBeTruthy();
});

View file

@ -2,32 +2,35 @@ import {Component, Input} from '@angular/core';
import {Step} from '../step';
import {Converter} from '../converter/converter';
import {InputComponentManagerService} from '../input-component-manager.service';
import {FormsModule} from '@angular/forms';
@Component({
selector: 'app-text-input-field',
templateUrl: './text-input-field.component.html',
styleUrls: ['./text-input-field.component.scss']
standalone: true,
styleUrls: ['./text-input-field.component.scss'],
imports: [FormsModule]
})
export class TextInputFieldComponent {
@Input()
public step: Step;
public step!: Step;
constructor(private inputComponentManagerService: InputComponentManagerService) {
}
update(step: Step): void {
const converter: Converter = step.selectedConverter;
const converter: Converter | undefined = step.selectedConverter;
if (converter !== undefined) {
const content: string = step.content;
let result: string;
let result: string | null;
try {
result = converter.convert(content);
} catch (error) {
if (typeof console === 'object' && typeof console.log === 'function') {
console.log(error);
}
step.message = error.message;
step.message = (error as Error).message;
step.error = true;
result = null;
}

View file

@ -1,18 +1,18 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {VersionComponent} from './version.component';
import {environment} from '../../environments/environment';
import packageInfo from '../../../package.json';
describe('VersionComponent', () => {
let component: VersionComponent;
let fixture: ComponentFixture<VersionComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [VersionComponent]
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [VersionComponent]
})
.compileComponents();
}));
});
beforeEach(() => {
fixture = TestBed.createComponent(VersionComponent);
@ -20,13 +20,13 @@ describe('VersionComponent', () => {
fixture.detectChanges();
});
it('should create', () => {
it('should create the component', () => {
expect(component).toBeTruthy();
});
it('should contain the correct version', () => {
// when executing the test, we're always running with the dev environment
expect(component.VERSION).toEqual(`${environment.appVersion} (development build)`);
expect(component.VERSION).toEqual(`${packageInfo.version} (development build)`);
});
it('should have the correct value for the "production" property', () => {

View file

@ -1,14 +1,17 @@
import {Component} from '@angular/core';
import {environment} from '../../environments/environment';
import {Component, isDevMode} from '@angular/core';
import {CommonModule} from '@angular/common';
import packageInfo from '../../../package.json';
@Component({
selector: 'app-version',
templateUrl: './version.component.html',
styleUrls: ['./version.component.scss']
standalone: true,
styleUrls: ['./version.component.scss'],
imports: [CommonModule]
})
export class VersionComponent {
public readonly PROD: boolean = environment.production;
public readonly VERSION: string = environment.appVersion + (this.PROD ? '' : ' (development build)');
public readonly PROD: boolean = !isDevMode();
public readonly VERSION: string = packageInfo.version + (this.PROD ? '' : ' (development build)');
constructor() {
}

View file

@ -1,11 +0,0 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11

View file

@ -1,4 +0,0 @@
export const environment = {
production: true,
appVersion: require('../../package.json').version
};

View file

@ -1,16 +0,0 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false,
appVersion: require('../../package.json').version
};
/*
* In development mode, for easier debugging, you can ignore zone related error
* stack frames such as `zone.run`/`zoneDelegate.invokeTask` by importing the
* below file. Don't forget to comment it out in production mode
* because it will have a performance impact when errors are thrown
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

View file

@ -1,40 +0,0 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-chrome-launcher'),
require('karma-jasmine'),
require('karma-nightmare'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeHeadless'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
singleRun: false
});
};

View file

@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));

View file

@ -1,76 +0,0 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
/** Evergreen browsers require these. **/
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
// import 'core-js/es7/reflect';
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js'; // Included with Angular CLI.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
*/
// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
/*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// (window as any).__Zone_enable_cross_context_check = true;
/***************************************************************************************************
* APPLICATION IMPORTS
*/

View file

@ -1,20 +0,0 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View file

@ -1,13 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": [
"node"
]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}

View file

@ -1,18 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View file

@ -1,17 +0,0 @@
{
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
}