Skip to content

Commit

Permalink
Fix issue with array sorting in Node.js 12
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Jul 1, 2021
1 parent 0e476e5 commit fc9d4cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/api_integration/apis/saved_objects/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ export default ({ getService }) => {
// The polling instance and the migrating instance should both
// return a similar migraiton result.
assert.deepEqual(
result.map(({ status, destIndex }) => ({ status, destIndex })).sort((a) => a.destIndex ? 0 : 1),
result.map(({ status, destIndex }) => ({ status, destIndex })).sort((a, b) => {
if (a.status > b.status) return 1;
else if (a.status < b.status) return -1;
return 0;
}),
[
{ status: 'migrated', destIndex: '.migration-c_2' },
{ status: 'skipped', destIndex: undefined },
Expand Down

0 comments on commit fc9d4cf

Please sign in to comment.