diff --git a/src/config.test.ts b/src/config.test.ts index cb90738..d3932a8 100644 --- a/src/config.test.ts +++ b/src/config.test.ts @@ -43,10 +43,10 @@ radarr: {} test("should transform without error - quality_profiles instead of assign_scores_to", async () => { const cloned = cloneWithJSON(config); - const instance = cloned.sonarr!["instance1"]; - const { assign_scores_to, quality_profiles, ...rest } = instance.custom_formats![0]; + const instance = cloned.sonarr!["instance1"]!; + const cF = instance.custom_formats![0]; - instance.custom_formats![0] = { ...rest, quality_profiles: assign_scores_to ?? quality_profiles }; + instance.custom_formats![0] = { ...cF, quality_profiles: cF?.assign_scores_to, assign_scores_to: undefined }; const transformed = transformConfig(config); expect(transformed).not.toBeNull(); diff --git a/src/util.test.ts b/src/util.test.ts index 026a256..789eec1 100644 --- a/src/util.test.ts +++ b/src/util.test.ts @@ -154,7 +154,7 @@ describe("SizeSpecification", async () => { test("mismatch required", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); - copied.specifications![0].required = true; + copied.specifications![0]!.required = true; const result = compareCustomFormats(serverResponse, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(false); @@ -162,7 +162,7 @@ describe("SizeSpecification", async () => { test("max differ", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); - (copied.specifications![0].fields as TrashCFSpF).max = 100; + (copied.specifications![0]!.fields as TrashCFSpF).max = 100; const result = compareCustomFormats(serverResponse, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(false); @@ -200,9 +200,9 @@ describe("compareImportCFs - general", async () => { test("should not diff for fields length equal length", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); const clonedServer = cloneWithJSON(serverResponse); - clonedServer.specifications![0].fields = [clonedServer.specifications![0].fields![0]]; + clonedServer.specifications![0]!.fields = [clonedServer.specifications![0]!.fields![0]!]; - expect(clonedServer.specifications![0].fields.length).toBe(1); + expect(clonedServer.specifications![0]!.fields.length).toBe(1); const result = compareCustomFormats(clonedServer, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(true); @@ -210,12 +210,12 @@ describe("compareImportCFs - general", async () => { test("should diff for fields length if local is higher (should not happen normally)", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); - copied.specifications![0].fields!.exceptLanguage = false; + copied.specifications![0]!.fields!.exceptLanguage = false; const clonedServer = cloneWithJSON(serverResponse); - clonedServer.specifications![0].fields = [clonedServer.specifications![0].fields![0]]; + clonedServer.specifications![0]!.fields = [clonedServer.specifications![0]!.fields![0]!]; - expect(clonedServer.specifications![0].fields.length).toBe(1); + expect(clonedServer.specifications![0]!.fields.length).toBe(1); const result = compareCustomFormats(clonedServer, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(false); @@ -224,10 +224,10 @@ describe("compareImportCFs - general", async () => { test("should diff for specifications length bigger on remote", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); const clonedServer = cloneWithJSON(serverResponse); - clonedServer.specifications![0].fields = [clonedServer.specifications![0].fields![0]]; - clonedServer.specifications?.push(clonedServer.specifications![0]); + clonedServer.specifications![0]!.fields = [clonedServer.specifications![0]!.fields![0]!]; + clonedServer.specifications?.push(clonedServer.specifications![0]!); - expect(clonedServer.specifications![0].fields.length).toBe(1); + expect(clonedServer.specifications![0]!.fields.length).toBe(1); const result = compareCustomFormats(clonedServer, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(false); @@ -236,10 +236,10 @@ describe("compareImportCFs - general", async () => { test("should diff for specifications length smaller on remote", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); const clonedServer = cloneWithJSON(serverResponse); - clonedServer.specifications![0].fields = [clonedServer.specifications![0].fields![0]]; - copied.specifications?.push(copied.specifications[0]); + clonedServer.specifications![0]!.fields = [clonedServer.specifications![0]!.fields![0]!]; + copied.specifications?.push(copied.specifications[0]!); - expect(clonedServer.specifications![0].fields.length).toBe(1); + expect(clonedServer.specifications![0]!.fields.length).toBe(1); const result = compareCustomFormats(clonedServer, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(false); @@ -248,9 +248,9 @@ describe("compareImportCFs - general", async () => { test("should not diff for specifications length equal", async () => { const copied: typeof custom = JSON.parse(JSON.stringify(custom)); const clonedServer = cloneWithJSON(serverResponse); - clonedServer.specifications![0].fields = [clonedServer.specifications![0].fields![0]]; + clonedServer.specifications![0]!.fields = [clonedServer.specifications![0]!.fields![0]!]; - expect(clonedServer.specifications![0].fields.length).toBe(1); + expect(clonedServer.specifications![0]!.fields.length).toBe(1); const result = compareCustomFormats(clonedServer, mapImportCfToRequestCf(toCarrCF(copied))); expect(result.equal).toBe(true); diff --git a/tests/e2e/demo-todo-app.spec.ts b/tests/e2e/demo-todo-app.spec.ts index 4c465a9..1918f36 100644 --- a/tests/e2e/demo-todo-app.spec.ts +++ b/tests/e2e/demo-todo-app.spec.ts @@ -1,11 +1,11 @@ -import { test, expect, type Page } from "@playwright/test"; +import { expect, test, type Page } from "@playwright/test"; + +const TODO_ITEMS = ["buy some cheese", "feed the cat", "book a doctors appointment"] as const; test.beforeEach(async ({ page }) => { await page.goto("https://demo.playwright.dev/todomvc"); }); -const TODO_ITEMS = ["buy some cheese", "feed the cat", "book a doctors appointment"]; - test.describe("New Todo", () => { test("should allow me to add todo items", async ({ page }) => { // create a new todo locator diff --git a/tsconfig.json b/tsconfig.json index 085d0ae..34f4667 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,8 @@ "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { "allowJs": true, - "baseUrl": ".", + // breaks esbuild import + // "baseUrl": ".", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, @@ -17,7 +18,8 @@ "skipLibCheck": true, "strict": true, "strictNullChecks": true, - "target": "ESNext" + "target": "ESNext", + "noEmit": true }, "exclude": ["./dist"], "include": ["**/*.ts", "**/*.tsx"]