Skip to content

Commit

Permalink
rename func
Browse files Browse the repository at this point in the history
  • Loading branch information
fungairino committed Jun 21, 2024
1 parent d24ab46 commit 9052d8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions end-to-end-tests/fixtures/modDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { expect } from "@playwright/test";
import { test as pageContextFixture } from "./pageContext";
import { WorkshopPage } from "../pageObjects/extensionConsole/workshop/workshopPage";

// Removes any uuids from the text
function normalize(string: string) {
// Replaces any uuids in the text with a fixed value to make snapshots more stable
function normalizeUUids(string: string) {
return string.replaceAll(
// eslint-disable-next-line unicorn/better-regex -- more clear this way
/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,
Expand Down Expand Up @@ -77,7 +77,7 @@ export const test = pageContextFixture.extend<{
await workshopPage.goto();
const editPage = await workshopPage.findAndSelectMod(modId);

const normalizedModDefinitionYaml = normalize(
const normalizedModDefinitionYaml = normalizeUUids(
await editPage.editor.getValue(),
);
expect(normalizedModDefinitionYaml).toMatchSnapshot(snapshotName);
Expand Down

0 comments on commit 9052d8c

Please sign in to comment.