Skip to content

Commit

Permalink
fix(e2e): eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jokesterfr committed Sep 13, 2024
1 parent 898bda7 commit 74fcb83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions e2e/src/full-sync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe("Full Sync", () => {
const message$ = probe({ url: `/upload/${jobId}` }, { timeout: 4000 });

// act
const syncedData: PsEventbusSyncUpload[] = await lastValueFrom(
const syncedData = await lastValueFrom(
zip(fullSync$, message$).pipe(
map((msg) => msg[1].body.file),
concatMap((syncedPage) => {
Expand All @@ -187,14 +187,14 @@ describe("Full Sync", () => {
);

// dump data for easier debugging or updating fixtures
let processedData = syncedData as PsEventbusSyncUpload[];
if (testConfig.dumpFullSyncData) {
await dumpUploadData(syncedData, controller);
await dumpUploadData(processedData, controller);
}

const fixture = await loadFixture(controller);

// we need to process fixtures and data returned from ps_eventbus to make them easier to compare
let processedData = syncedData;
let processedFixture = fixture;
if (controller === "apiModules") {
processedData = generatePredictableModuleId(processedData);
Expand All @@ -215,7 +215,7 @@ describe("Full Sync", () => {
expect(processedData).toMatchObject(processedFixture);

// assert special field using custom matcher
for (const data of syncedData) {
for (const data of processedData) {
for (const specialFieldName of Object.keys(specialFieldAssert)) {
if (data.properties[specialFieldName] !== undefined) {
specialFieldAssert[specialFieldName](
Expand Down
7 changes: 5 additions & 2 deletions e2e/src/helpers/data-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export const sortUploadData: (
export function generatePredictableModuleId(
data: PsEventbusSyncUpload[],
): PsEventbusSyncUpload[] {
return data.map((it) => ({ ...it, id: `${it.properties.name}` }));
return data.map((it) => ({
...it,
id: `${(it.properties as { name: string }).name}`,
}));
}

export function omitProperties(
Expand All @@ -35,7 +38,7 @@ export function omitProperties(
): PsEventbusSyncUpload[] {
return data.map((it) => ({
...it,
properties: R.omit(omitFields, it.properties),
properties: R.omit(omitFields as never[], it.properties),
}));
}

Expand Down

0 comments on commit 74fcb83

Please sign in to comment.