test: avoid filter allocation assertions

This commit is contained in:
Peter Steinberger
2026-05-08 21:26:50 +01:00
parent c7a0a7af7b
commit 9bc8237f7b
5 changed files with 9 additions and 9 deletions

View File

@@ -8,11 +8,11 @@ import {
} from "../../scripts/lib/bundled-plugin-build-entries.mjs";
function expectNoPrefixMatches(values: string[], prefix: string) {
expect(values.filter((value) => value.startsWith(prefix))).toEqual([]);
expect(values.some((value) => value.startsWith(prefix))).toBe(false);
}
function expectSomePrefixMatch(values: string[], prefix: string) {
expect(values.filter((value) => value.startsWith(prefix)).length).toBeGreaterThan(0);
expect(values.some((value) => value.startsWith(prefix))).toBe(true);
}
describe("bundled plugin build entries", () => {