Skip to content

Commit

Permalink
Merge pull request #23 from Cherry/chore/test-array-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherry authored Oct 4, 2024
2 parents 8eb2098 + 5320f83 commit ece1fe1
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions test/problemMatcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,11 @@ describe('adds matcher', () => {
});

await expect(htmllintProblemMatcher()).resolves.toBeUndefined();

let hasMatch = false;
for (const log of logs) {
if (typeof log === 'string' && log.includes('::add-matcher')) {
hasMatch = true;
break;
}
}
expect(hasMatch).toBe(true);
expect(logs).toEqual(
expect.arrayContaining([
expect.stringContaining('::add-matcher::'),
]),
);
logMock.mockRestore();
});
});
Expand All @@ -149,15 +145,11 @@ describe('removes matcher', () => {
});

await expect(htmllintProblemMatcher()).resolves.toBeUndefined();

let hasMatch = false;
for (const log of logs) {
if (typeof log === 'string' && log.includes('::remove-matcher')) {
hasMatch = true;
break;
}
}
expect(hasMatch).toBe(true);
expect(logs).toEqual(
expect.arrayContaining([
expect.stringContaining('::remove-matcher'),
]),
);
logMock.mockRestore();
});
});

0 comments on commit ece1fe1

Please sign in to comment.