mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
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:
parent
44449c5246
commit
21b63fa42b
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue