Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  normalize-job-identity.test.ts

  Sprache: JAVA
 

import { describe, expect, it } from "vitest";
import { normalizeCronJobIdentityFields } from "./normalize-job-identity.js";

describe("normalizeCronJobIdentityFields", () => {
  it("copies trimmed jobId into id when id is missing", () => {
    const raw: Record<string, unknown> = {
      jobId: "  stable-slug  ",
      name: "n",
    };
    const r = normalizeCronJobIdentityFields(raw);
    expect(r.mutated).toBe(true);
    expect(r.legacyJobIdIssue).toBe(true);
    expect(raw.id).toBe("stable-slug");
    expect(raw.jobId).toBeUndefined();
  });

  it("trims id without reporting a legacy jobId issue when jobId is absent", () => {
    const raw: Record<string, unknown> = {
      id: "  trimmed-id  ",
      name: "n",
    };
    const r = normalizeCronJobIdentityFields(raw);
    expect(r.mutated).toBe(true);
    expect(r.legacyJobIdIssue).toBe(false);
    expect(raw.id).toBe("trimmed-id");
  });

  it("removes redundant jobId while keeping canonical id", () => {
    const raw: Record<string, unknown> = {
      id: "keep-me",
      jobId: "keep-me",
      name: "n",
    };
    const r = normalizeCronJobIdentityFields(raw);
    expect(r.mutated).toBe(true);
    expect(r.legacyJobIdIssue).toBe(true);
    expect(raw.id).toBe("keep-me");
    expect(raw.jobId).toBeUndefined();
  });

  it("ignores non-string jobId", () => {
    const raw: Record<string, unknown> = {
      id: "x",
      jobId: 1,
      name: "n",
    };
    const r = normalizeCronJobIdentityFields(raw);
    expect(r.mutated).toBe(true);
    expect(r.legacyJobIdIssue).toBe(true);
    expect(raw.id).toBe("x");
    expect(raw.jobId).toBeUndefined();
  });
});

Messung V0.5 in Prozent
C=100 H=99 G=99

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-05-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge