Fix tests

This commit is contained in:
pietervdvn 2022-02-18 00:12:32 +01:00
parent f55e5cf26c
commit fb4a3ea99a
2 changed files with 4 additions and 4 deletions

View file

@ -226,7 +226,7 @@ export class DetectShadowedMappings extends DesugaringStep<TagRenderingConfigJso
}
const parsedConditions = json.mappings.map(m => TagUtils.Tag(m.if))
for (let i = 0; i < json.mappings.length; i++) {
if (!parsedConditions[i].isUsableAsAnswer()) {
if(json.mappings[i].hideInAnswer === true){
continue
}
const keyValues = parsedConditions[i].asChange({});
@ -241,7 +241,7 @@ export class DetectShadowedMappings extends DesugaringStep<TagRenderingConfigJso
const doesMatch = parsedConditions[j].matchesProperties(properties)
if (doesMatch) {
// The current mapping is shadowed!
warnings.push(`At ${context}: Mapping ${i} is shadowed by mapping ${j} and will thus never be shown:
errors.push(`At ${context}: Mapping ${i} is shadowed by mapping ${j} and will thus never be shown:
The mapping ${parsedConditions[i].asHumanString(false, false, {})} is fully matched by a previous mapping, which matches:
${parsedConditions[j].asHumanString(false, false, {})}.

View file

@ -423,7 +423,7 @@ export default class LegacyThemeLoaderSpec extends T {
}
]
}, "test");
T.isTrue(r.errors.length > 0, "Failing case is not detected")
T.isTrue(r.errors.length > 0, "Failing case 0 is not detected")
const r0 = new DetectShadowedMappings().convert( {
mappings: [
@ -437,7 +437,7 @@ export default class LegacyThemeLoaderSpec extends T {
}
]
}, "test");
T.isTrue(r0.errors.length > 0, "Failing case is not detected")
T.isTrue(r0.errors.length > 0, "Failing case 1 is not detected")
}
],
["Images are rewritten", () => {