Skip to content

Commit b9efa7b

Browse files
committed
fix(test): fix testing issue
1 parent d8dc826 commit b9efa7b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/reactant-share/test/case.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,5 +892,12 @@ test('fork with args with destroy on Server', async () => {
892892
expect(server.instance.count).toBe(1);
893893
expect(client0.instance.count).toBe(1);
894894

895-
await expect(client0.instance.increase()).rejects.toThrowError();
895+
await expect(
896+
Promise.race([
897+
client0.instance.increase(),
898+
new Promise((resolve) => {
899+
setTimeout(() => resolve('timeout'), 100);
900+
}),
901+
])
902+
).resolves.toBe('timeout');
896903
});

0 commit comments

Comments
 (0)