diff --git a/packages/e2e-tests/vite-ssr-esm/__tests__/vite-ssr-esm.spec.ts b/packages/e2e-tests/vite-ssr-esm/__tests__/vite-ssr-esm.spec.ts
index 014bc03e3..2498e5134 100644
--- a/packages/e2e-tests/vite-ssr-esm/__tests__/vite-ssr-esm.spec.ts
+++ b/packages/e2e-tests/vite-ssr-esm/__tests__/vite-ssr-esm.spec.ts
@@ -63,17 +63,17 @@ if (!isBuild) {
'
foo
\n'
)
);
- expect(await getText(`#hmr-test`)).toBe('foo');
+ await untilMatches(() => getText(`#hmr-test`), 'foo', '#hmr-test contains text foo');
});
test('should apply style update', async () => {
expect(await getColor(`h1`)).toBe('green');
await updateApp((content) => content.replace('color: green', 'color: red'));
- expect(await getColor(`h1`)).toBe('red');
+ await untilMatches(() => getColor('h1'), 'red', 'h1 has color red');
});
test('should not preserve state of updated props', async () => {
expect(await getText(`#foo`)).toBe('foo');
await updateApp((content) => content.replace("foo = 'foo'", "foo = 'bar'"));
- expect(await getText(`#foo`)).toBe('bar');
+ await untilMatches(() => getText(`#foo`), 'bar', '#foo contains text bar');
});
});
}
diff --git a/packages/e2e-tests/vite-ssr/__tests__/vite-ssr.spec.ts b/packages/e2e-tests/vite-ssr/__tests__/vite-ssr.spec.ts
index 99de1df6b..108a48a62 100644
--- a/packages/e2e-tests/vite-ssr/__tests__/vite-ssr.spec.ts
+++ b/packages/e2e-tests/vite-ssr/__tests__/vite-ssr.spec.ts
@@ -59,17 +59,17 @@ if (!isBuild) {
'foo
\n'
)
);
- expect(await getText(`#hmr-test`)).toBe('foo');
+ await untilMatches(() => getText(`#hmr-test`), 'foo', '#hmr-test contains text foo');
});
test('should apply style update', async () => {
expect(await getColor(`h1`)).toBe('green');
await updateApp((content) => content.replace('color: green', 'color: red'));
- expect(await getColor(`h1`)).toBe('red');
+ await untilMatches(() => getColor('h1'), 'red', 'h1 has color red');
});
test('should not preserve state of updated props', async () => {
expect(await getText(`#foo`)).toBe('foo');
await updateApp((content) => content.replace("foo = 'foo'", "foo = 'bar'"));
- expect(await getText(`#foo`)).toBe('bar');
+ await untilMatches(() => getText(`#foo`), 'bar', '#foo contains text bar');
});
});
}