test: dedupe repeated validation and throw assertions

This commit is contained in:
Peter Steinberger
2026-02-21 23:21:35 +00:00
parent 01ec832f78
commit 98790339ef
4 changed files with 49 additions and 26 deletions

View File

@@ -142,8 +142,8 @@ describe("resolveConfigIncludes", () => {
for (const testCase of cases) {
const files = { [configPath(testCase.includeFile)]: testCase.included };
const obj = { $include: `./${testCase.includeFile}`, extra: true };
expect(() => resolve(obj, files), testCase.includeFile).toThrow(ConfigIncludeError);
expect(() => resolve(obj, files), testCase.includeFile).toThrow(
expectResolveIncludeError(
() => resolve(obj, files),
/Sibling keys require included content to be an object/,
);
}