feat: linter and tests work now
Node.js CI / CI (pull_request) Successful in 32s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 53s

This commit is contained in:
2025-12-27 12:42:17 -08:00
parent 7e7dd9c134
commit 6bbcb4d8fa
9 changed files with 120 additions and 40 deletions
+12 -8
View File
@@ -1,11 +1,15 @@
import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import {
type ApplicationConfig,
provideBrowserGlobalErrorListeners,
} from "@angular/core";
import { provideRouter } from "@angular/router";
import { routes } from "./app.routes";
export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideRouter(routes)
]
providers: [ provideBrowserGlobalErrorListeners(), provideRouter(routes) ],
};
+6 -1
View File
@@ -1,3 +1,8 @@
import { Routes } from '@angular/router';
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import type { Routes } from "@angular/router";
export const routes: Routes = [];
+22 -9
View File
@@ -1,23 +1,36 @@
import { TestBed } from '@angular/core/testing';
import { App } from './app';
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { TestBed } from "@angular/core/testing";
import { describe, beforeEach, it, expect } from "vitest";
import { App } from "./app";
describe('App', () => {
beforeEach(async () => {
describe("app", () => {
beforeEach(async() => {
await TestBed.configureTestingModule({
imports: [App],
imports: [ App ],
}).compileComponents();
});
it('should create the app', () => {
it("should create the app", () => {
expect.assertions(1);
const fixture = TestBed.createComponent(App);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
expect(app, "did not compile").toBeTruthy();
});
it('should render title', async () => {
it("should render title", async() => {
expect.assertions(1);
const fixture = TestBed.createComponent(App);
await fixture.whenStable();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, lore');
expect(
compiled.querySelector("h1")?.textContent,
"did not render title",
).toContain(
"Hello, lore",
);
});
});
+15 -7
View File
@@ -1,12 +1,20 @@
import { Component, signal } from '@angular/core';
import { RouterOutlet } from '@angular/router';
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { Component, signal } from "@angular/core";
import { RouterOutlet } from "@angular/router";
/**
* The root component for the application.
*/
@Component({
selector: 'app-root',
imports: [RouterOutlet],
templateUrl: './app.html',
styleUrl: './app.css'
imports: [ RouterOutlet ],
selector: "app-root",
styleUrl: "./app.css",
templateUrl: "./app.html",
})
export class App {
protected readonly title = signal('lore');
protected readonly title = signal("lore");
}
+13 -5
View File
@@ -1,6 +1,14 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { App } from './app/app';
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { bootstrapApplication } from "@angular/platform-browser";
import { App } from "./app/app";
import { appConfig } from "./app/app.config";
bootstrapApplication(App, appConfig)
.catch((err) => console.error(err));
bootstrapApplication(App, appConfig).
// eslint-disable-next-line unicorn/prefer-top-level-await -- No top level await in a web app
catch((error: unknown) => {
console.error(error);
});