Skip to content

Commit

Permalink
test: fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Almouro committed Oct 28, 2024
1 parent ddfcac2 commit d880ea5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/commands/measure/src/__tests__/measure.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ describe("flashlight measure interactive", () => {
// Simulate measures being emitted on the device
act(() => emitMeasures());

// We should now see 1000ms of measures: 3 measures at 0/500/1000ms
await screen.findByText("1000 ms");
// Find the score!
await screen.findByText("47");
screen.getByText("47");

// expand threads
await screen.findByText("Other threads");
Expand All @@ -106,8 +108,8 @@ describe("flashlight measure interactive", () => {

// Stop measuring
fireEvent.click(screen.getByText("Stop Measuring"));
await waitFor(() => expect(aTraceMock.kill).toBeCalled());
await waitFor(() => expect(perfProfilerMock.kill).toBeCalled());
await waitFor(() => expect(aTraceMock.kill).toHaveBeenCalled());
await waitFor(() => expect(perfProfilerMock.kill).toHaveBeenCalled());

// Close apps

Expand Down

0 comments on commit d880ea5

Please sign in to comment.