From 9e470b5c61772850c8b9b9ebe57b669f1a0f34e8 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sun, 4 Aug 2024 16:04:10 +0530 Subject: [PATCH] chore: fix tests on windows --- ...st-to-index-route-normalized-options-snap.webpack5} | 0 ...st-to-index-route-normalized-options-snap.webpack5} | 0 ...st-to-index-route-normalized-options-snap.webpack5} | 0 ...st-to-index-route-normalized-options-snap.webpack5} | 0 ...st-to-index-route-normalized-options-snap.webpack5} | 0 test/e2e/server.test.js | 10 +++++----- test/helpers/playwright-custom-expects.js | 5 ++--- 7 files changed, 7 insertions(+), 8 deletions(-) rename test/e2e/__snapshots__/server.test.js/{server-option-as-object-ca-pfx-key-and-cert-are-array-of-buffers-should-handle-GET-request-to-index-route-undefined-snap.webpack5 => server-option-as-object-ca-pfx-key-and-cert-are-array-of-buffers-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5} (100%) rename test/e2e/__snapshots__/server.test.js/{server-option-as-object-ca-pfx-key-and-cert-are-array-of-paths-to-files-should-handle-GET-request-to-index-route-undefined-snap.webpack5 => server-option-as-object-ca-pfx-key-and-cert-are-array-of-paths-to-files-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5} (100%) rename test/e2e/__snapshots__/server.test.js/{server-option-as-object-ca-pfx-key-and-cert-are-array-of-strings-should-handle-GET-request-to-index-route-undefined-snap.webpack5 => server-option-as-object-ca-pfx-key-and-cert-are-array-of-strings-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5} (100%) rename test/e2e/__snapshots__/server.test.js/{server-option-as-object-ca-pfx-key-and-cert-are-paths-to-files-should-handle-GET-request-to-index-route-undefined-snap.webpack5 => server-option-as-object-ca-pfx-key-and-cert-are-paths-to-files-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5} (100%) rename test/e2e/__snapshots__/server.test.js/{server-option-as-object-ca-pfx-key-and-cert-are-strings-should-handle-GET-request-to-index-route-undefined-snap.webpack5 => server-option-as-object-ca-pfx-key-and-cert-are-strings-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5} (100%) diff --git a/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-buffers-should-handle-GET-request-to-index-route-undefined-snap.webpack5 b/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-buffers-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 similarity index 100% rename from test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-buffers-should-handle-GET-request-to-index-route-undefined-snap.webpack5 rename to test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-buffers-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 diff --git a/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-paths-to-files-should-handle-GET-request-to-index-route-undefined-snap.webpack5 b/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-paths-to-files-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 similarity index 100% rename from test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-paths-to-files-should-handle-GET-request-to-index-route-undefined-snap.webpack5 rename to test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-paths-to-files-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 diff --git a/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-strings-should-handle-GET-request-to-index-route-undefined-snap.webpack5 b/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-strings-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 similarity index 100% rename from test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-strings-should-handle-GET-request-to-index-route-undefined-snap.webpack5 rename to test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-array-of-strings-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 diff --git a/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-paths-to-files-should-handle-GET-request-to-index-route-undefined-snap.webpack5 b/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-paths-to-files-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 similarity index 100% rename from test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-paths-to-files-should-handle-GET-request-to-index-route-undefined-snap.webpack5 rename to test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-paths-to-files-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 diff --git a/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-strings-should-handle-GET-request-to-index-route-undefined-snap.webpack5 b/test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-strings-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 similarity index 100% rename from test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-strings-should-handle-GET-request-to-index-route-undefined-snap.webpack5 rename to test/e2e/__snapshots__/server.test.js/server-option-as-object-ca-pfx-key-and-cert-are-strings-should-handle-GET-request-to-index-route-normalized-options-snap.webpack5 diff --git a/test/e2e/server.test.js b/test/e2e/server.test.js index 056da244c3..7edb531f7f 100644 --- a/test/e2e/server.test.js +++ b/test/e2e/server.test.js @@ -338,7 +338,7 @@ test.describe("server option", () => { expect( normalizeOptions(createServerSpy.getCall(0).args[0]), - ).toMatchSnapshotWithArray(); + ).toMatchSnapshotWithArray("normalized options"); expect(response.status()).toBe(200); await expect(page).toHaveScreenshot(); expect( @@ -422,7 +422,7 @@ test.describe("server option", () => { expect( normalizeOptions(createServerSpy.getCall(0).args[0]), - ).toMatchSnapshotWithArray(); + ).toMatchSnapshotWithArray("normalized options"); expect(response.status()).toBe(200); await expect(page).toHaveScreenshot(); expect( @@ -515,7 +515,7 @@ test.describe("server option", () => { expect( normalizeOptions(createServerSpy.getCall(0).args[0]), - ).toMatchSnapshotWithArray(); + ).toMatchSnapshotWithArray("normalized options"); expect(response.status()).toBe(200); await expect(page).toHaveScreenshot(); expect( @@ -585,7 +585,7 @@ test.describe("server option", () => { expect( normalizeOptions(createServerSpy.getCall(0).args[0]), - ).toMatchSnapshotWithArray(); + ).toMatchSnapshotWithArray("normalized options"); expect(response.status()).toBe(200); await expect(page).toHaveScreenshot(); expect( @@ -655,7 +655,7 @@ test.describe("server option", () => { expect( normalizeOptions(createServerSpy.getCall(0).args[0]), - ).toMatchSnapshotWithArray(); + ).toMatchSnapshotWithArray("normalized options"); expect(response.status()).toBe(200); await expect(page).toHaveScreenshot(); expect( diff --git a/test/helpers/playwright-custom-expects.js b/test/helpers/playwright-custom-expects.js index a5286d4ca7..347cc01dfb 100644 --- a/test/helpers/playwright-custom-expects.js +++ b/test/helpers/playwright-custom-expects.js @@ -12,9 +12,8 @@ const { test, expect, mergeExpects } = require("@playwright/test"); * @returns {string} a new string with all EOL markers replaced * @private */ -const normalizeLineEndings = (input) => { - return input.replace(/(\r\n|\n|\r)/gmu, os.EOL); -}; +const normalizeLineEndings = (input) => + input.replace(/(\r\n|\n|\r)/gmu, os.EOL); /** * Custom Playwright matcher to match a snapshot with an array.