Skip to content

Commit

Permalink
chore: fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Aug 4, 2024
1 parent 7a78abd commit 9e470b5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions test/e2e/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions test/helpers/playwright-custom-expects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9e470b5

Please sign in to comment.