Im rule test (#161231)

There was some failure, for IM rule tests.
Probably because we are comparing alerts in the array, they can be in a
different order, so sorting should help
This commit is contained in:
Khristinin Nikita 2023-07-06 06:33:22 +02:00 committed by GitHub
parent 44449c5246
commit 21b63fa42b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,10 @@ function alertsAreTheSame(alertsA: any[], alertsB: any[]): void {
]);
};
expect(alertsA.map(mapAlert)).to.eql(alertsB.map(mapAlert));
const sort = (alerts: any[]) =>
alerts.sort((a: any, b: any) => a.message.localeCompare(b.message));
expect(sort(alertsA.map(mapAlert))).to.eql(sort(alertsB.map(mapAlert)));
}
// eslint-disable-next-line import/no-default-export