Skip to content

Commit

Permalink
chore: fix flaky test timing
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert committed Aug 22, 2024
1 parent 0f187fe commit ad46ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/test/test-provider.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('OpenFeatureTestProvider', () => {

// should only be resolved after delay
expect(screen.getByText('πŸ‘Ž')).toBeInTheDocument();
await new Promise((resolve) => setTimeout(resolve, delay * 2));
await new Promise((resolve) => setTimeout(resolve, delay * 4));
expect(screen.getByText('πŸ‘')).toBeInTheDocument();
});
});
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('OpenFeatureTestProvider', () => {

// should initially show fallback, then resolve
expect(screen.getByText('πŸ•’')).toBeInTheDocument();
await new Promise((resolve) => setTimeout(resolve, delay * 2));
await new Promise((resolve) => setTimeout(resolve, delay * 4));
expect(screen.getByText('πŸ‘')).toBeInTheDocument();
});
});
Expand Down

0 comments on commit ad46ade

Please sign in to comment.