Skip to content

Commit

Permalink
Improve test to prevent flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
selinali2010 committed Oct 9, 2023
1 parent fffc53c commit 6d2a6a2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/__tests__/unit_tests/main/flush.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,28 @@ describe('flush', () => {
const returnedString = stateToString(defaultState);
expect(returnedString).toMatch(/Device: all\n\rChannel: all\n\r/);
expect(returnedString).toMatch(/Preamp: 0dB\n\r/);

// Check for that filters for each frequency exists
// Note: the order of filters in the string is determined by the generated filter id and not the frequency value
expect(returnedString).toMatch(/Filter\d: ON PK Fc 32 Hz Gain 0 dB Q 1/);
expect(returnedString).toMatch(/Filter\d: ON PK Fc 64 Hz Gain 0 dB Q 1/);
expect(returnedString).toMatch(/Filter\d: ON PK Fc 125 Hz Gain 0 dB Q 1/);
expect(returnedString).toMatch(/Filter\d: ON PK Fc 250 Hz Gain 0 dB Q 1/);
expect(returnedString).toMatch(/Filter\d: ON PK Fc 500 Hz Gain 0 dB Q 1/);
expect(returnedString).toMatch(
/Filter\d: ON PK Fc 1000 Hz Gain 0 dB Q 1/
);
expect(returnedString).toMatch(
/Filter\d: ON PK Fc 2000 Hz Gain 0 dB Q 1/
);
expect(returnedString).toMatch(
/Filter\d: ON PK Fc 4000 Hz Gain 0 dB Q 1/
);
expect(returnedString).toMatch(
/Filter0: ON PK Fc 32 Hz Gain 0 dB Q 1\n\r/
/Filter\d: ON PK Fc 8000 Hz Gain 0 dB Q 1/
);
expect(returnedString).toMatch(
/Filter9: ON PK Fc 16000 Hz Gain 0 dB Q 1/
/Filter\d: ON PK Fc 16000 Hz Gain 0 dB Q 1/
);
});
});
Expand Down

0 comments on commit 6d2a6a2

Please sign in to comment.