diff --git a/test/e2e/app-dir/metadata/metadata.test.ts b/test/e2e/app-dir/metadata/metadata.test.ts index 40285c99ae345..1f74967b229f7 100644 --- a/test/e2e/app-dir/metadata/metadata.test.ts +++ b/test/e2e/app-dir/metadata/metadata.test.ts @@ -31,7 +31,9 @@ createNextDescribe( if (Array.isArray(expected)) { expect(values).toEqual(expected) } 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) } } }