Unverified Commit d02f60b9 authored by Josh Story's avatar Josh Story Committed by GitHub

Loosen metatdata test matcher (#52007)

the metadata tests have an unnecessarily strict matcher which will fail if the matched metadata isn't the first instance of the element tag type. This will cause a problem when we start to preload bootstrap scripts which will cause preload links in all test cases that did not come from the metadata api itself
Co-authored-by: 's avatarJiachi Liu <4800338+huozhi@users.noreply.github.com>
parent 0fb5fa55
...@@ -31,7 +31,9 @@ createNextDescribe( ...@@ -31,7 +31,9 @@ createNextDescribe(
if (Array.isArray(expected)) { if (Array.isArray(expected)) {
expect(values).toEqual(expected) expect(values).toEqual(expected)
} else { } else {
expect(values[0]).toBe(expected) // If expected is undefined, then it should not exist.
// Otherwise, it should exist in the matched values.
expect(values.includes(expected)).toBe(expected !== undefined)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment